@@ -351,10 +351,10 @@ class ExporterConsole : public Component
351351 glyphPositions.clear ();
352352 int charIndex = 0 ;
353353 for (auto & line : layout) {
354+ // TextLayout on macOS/iOS considers whitespace as a character, but on Windows/Linux it does not
355+ #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD
354356 float lastX = 0 ;
355357 for (auto * run : line.runs ) {
356- // TextLayout on macOS/iOS considers whitespace as a character, but on Windows/Linux it does not
357- #if JUCE_WINDOWS || JUCE_LINUX || JUCE_BSD
358358 auto const runText = string.getText ().substring (run->stringRange .getStart (), run->stringRange .getEnd ());
359359 int glyphIndex = 0 ;
360360 for (int i = 0 ; i < runText.length (); ++i) {
@@ -372,10 +372,9 @@ class ExporterConsole : public Component
372372#else
373373 run->glyphs .getReference (glyphIndex).glyphCode == 32
374374#endif
375-
376375 )
377376 glyphIndex++;
378-
377+
379378 if (glyphIndex < run->glyphs .size ()) {
380379 auto const & glyph = run->glyphs .getReference (glyphIndex);
381380 auto const position = glyph.anchor + line.lineOrigin ;
@@ -387,16 +386,18 @@ class ExporterConsole : public Component
387386 lastX = info.bounds .getRight ();
388387 }
389388 }
389+ }
390390#else // JUCE_MAC or JUCE_IOS
391+ for (auto * run : line.runs ) {
391392 for (auto & glyph : run->glyphs ) {
392393 GlyphInfo info;
393394 auto position = glyph.anchor + line.lineOrigin ;
394395 info.bounds = Rectangle<float >(position.x + 4 , position.y - run->font .getAscent () - 12 , glyph.width , run->font .getHeight ());
395396 info.charIndex = charIndex++;
396397 glyphPositions.add (info);
397398 }
398- #endif
399399 }
400+ #endif
400401 }
401402
402403 needsGlyphPositionUpdate = false ;
0 commit comments