diff options
Diffstat (limited to 'src/gfx_layout.cpp')
-rw-r--r-- | src/gfx_layout.cpp | 19 |
1 files changed, 18 insertions, 1 deletions
diff --git a/src/gfx_layout.cpp b/src/gfx_layout.cpp index c493e69c3..c65ead90e 100644 --- a/src/gfx_layout.cpp +++ b/src/gfx_layout.cpp @@ -25,6 +25,10 @@ #include "os/windows/string_uniscribe.h" #endif /* WITH_UNISCRIBE */ +#ifdef WITH_COCOA +#include "os/macosx/string_osx.h" +#endif + #include "safeguards.h" @@ -670,7 +674,7 @@ Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsi } else { /* Line is new, layout it */ FontState old_state = state; -#if defined(WITH_ICU_LAYOUT) || defined(WITH_UNISCRIBE) +#if defined(WITH_ICU_LAYOUT) || defined(WITH_UNISCRIBE) || defined(WITH_COCOA) const char *old_str = str; #endif @@ -698,6 +702,16 @@ Layouter::Layouter(const char *str, int maxw, TextColour colour, FontSize fontsi } #endif +#ifdef WITH_COCOA + if (line.layout == NULL) { + GetLayouter<CoreTextParagraphLayoutFactory>(line, str, state); + if (line.layout == NULL) { + state = old_state; + str = old_str; + } + } +#endif + if (line.layout == NULL) { GetLayouter<FallbackParagraphLayoutFactory>(line, str, state); } @@ -841,6 +855,9 @@ void Layouter::ResetFontCache(FontSize size) #if defined(WITH_UNISCRIBE) UniscribeResetScriptCache(size); #endif +#if defined(WITH_COCOA) + MacOSResetScriptCache(size); +#endif } /** |