1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-10 23:44:24 +00:00

Add GlyphArrangementOptions for addFittedText and drawFittedText

The new options can be used to affect line spacing.
This commit is contained in:
attila 2025-05-06 19:43:09 +02:00 committed by Attila Szarvas
parent 787f7a4694
commit c61158ed3a
34 changed files with 323 additions and 13 deletions

View file

@ -1857,6 +1857,8 @@ add_library( ${BINARY_NAME}
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.h"
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
@ -4513,6 +4515,8 @@ set_source_files_properties(
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.h"
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"

View file

@ -2169,6 +2169,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@ -4381,6 +4384,7 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FontOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>

View file

@ -2944,6 +2944,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
@ -7455,6 +7458,9 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>

View file

@ -2169,6 +2169,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@ -4381,6 +4384,7 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FontOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>

View file

@ -2944,6 +2944,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
@ -7455,6 +7458,9 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>

View file

@ -1619,6 +1619,8 @@ add_library( ${BINARY_NAME}
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.h"
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
@ -3889,6 +3891,8 @@ set_source_files_properties(
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.h"
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"

View file

@ -1860,6 +1860,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@ -3794,6 +3797,7 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FontOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>

View file

@ -2452,6 +2452,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
@ -6414,6 +6417,9 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>

View file

@ -1749,6 +1749,8 @@ add_library( ${BINARY_NAME}
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.h"
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
@ -4172,6 +4174,8 @@ set_source_files_properties(
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.h"
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"

View file

@ -1994,6 +1994,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@ -4027,6 +4030,7 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FontOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>

View file

@ -2659,6 +2659,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
@ -6849,6 +6852,9 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>

View file

@ -1994,6 +1994,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@ -4027,6 +4030,7 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FontOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>

View file

@ -2659,6 +2659,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
@ -6849,6 +6852,9 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>

View file

@ -1638,6 +1638,8 @@ add_library( ${BINARY_NAME}
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.h"
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"
@ -3988,6 +3990,8 @@ set_source_files_properties(
"../../../../../modules/juce_graphics/fonts/juce_FunctionPointerDestructor.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangement.h"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.cpp"
"../../../../../modules/juce_graphics/fonts/juce_GlyphArrangementOptions.h"
"../../../../../modules/juce_graphics/fonts/juce_LruCache.h"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.cpp"
"../../../../../modules/juce_graphics/fonts/juce_TextLayout.h"

View file

@ -1881,6 +1881,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@ -3892,6 +3895,7 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FontOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>

View file

@ -2506,6 +2506,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
@ -6576,6 +6579,9 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>

View file

@ -1023,6 +1023,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@ -2592,6 +2595,7 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FontOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>

View file

@ -1345,6 +1345,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
@ -4218,6 +4221,9 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>

View file

@ -1023,6 +1023,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@ -2592,6 +2595,7 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FontOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>

View file

@ -1345,6 +1345,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
@ -4218,6 +4221,9 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>

View file

@ -2002,6 +2002,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@ -4139,6 +4142,7 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FontOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>

View file

@ -2707,6 +2707,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
@ -7008,6 +7011,9 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>

View file

@ -2002,6 +2002,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@ -4139,6 +4142,7 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FontOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>

View file

@ -2707,6 +2707,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
@ -7008,6 +7011,9 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>

View file

@ -1880,6 +1880,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
@ -3868,6 +3871,7 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FontOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_FunctionPointerDestructor.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.h"/>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_Typeface.h"/>

View file

@ -2503,6 +2503,9 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\juce_TextLayout.cpp">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClCompile>
@ -6543,6 +6546,9 @@
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangement.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_GlyphArrangementOptions.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>
<ClInclude Include="..\..\..\..\modules\juce_graphics\fonts\juce_LruCache.h">
<Filter>JUCE Modules\juce_graphics\fonts</Filter>
</ClInclude>

View file

@ -461,14 +461,26 @@ void Graphics::drawText (const String& text, int x, int y, int width, int height
void Graphics::drawFittedText (const String& text, Rectangle<int> area,
Justification justification,
const int maximumNumberOfLines,
const float minimumHorizontalScale) const
const float minimumHorizontalScale,
GlyphArrangementOptions options) const
{
if (text.isEmpty() || area.isEmpty() || ! context.clipRegionIntersects (area))
return;
struct ArrangementArgs
{
auto tie() const noexcept { return std::tie (font, text, width, height, justification, maximumNumberOfLines, minimumHorizontalScale); }
auto tie() const noexcept
{
return std::tie (font,
text,
width,
height,
justification,
maximumNumberOfLines,
minimumHorizontalScale,
options);
}
bool operator< (const ArrangementArgs& other) const noexcept { return tie() < other.tie(); }
const Font font;
@ -478,6 +490,7 @@ void Graphics::drawFittedText (const String& text, Rectangle<int> area,
const Justification justification;
const int maximumNumberOfLines;
const float minimumHorizontalScale;
GlyphArrangementOptions options;
};
auto configureArrangement = [] (const ArrangementArgs& args)
@ -488,7 +501,8 @@ void Graphics::drawFittedText (const String& text, Rectangle<int> area,
args.width, args.height,
args.justification,
args.maximumNumberOfLines,
args.minimumHorizontalScale);
args.minimumHorizontalScale,
args.options);
return arrangement;
};
@ -498,7 +512,8 @@ void Graphics::drawFittedText (const String& text, Rectangle<int> area,
(float) area.getHeight(),
justification,
maximumNumberOfLines,
minimumHorizontalScale };
minimumHorizontalScale,
options };
using Cache = GlyphArrangementCache<ArrangementArgs>;
Cache::getInstance()->get (std::move (args), std::move (configureArrangement))
@ -509,10 +524,11 @@ void Graphics::drawFittedText (const String& text, Rectangle<int> area,
void Graphics::drawFittedText (const String& text, int x, int y, int width, int height,
Justification justification,
const int maximumNumberOfLines,
const float minimumHorizontalScale) const
const float minimumHorizontalScale,
GlyphArrangementOptions options) const
{
drawFittedText (text, coordsToRectangle (x, y, width, height),
justification, maximumNumberOfLines, minimumHorizontalScale);
justification, maximumNumberOfLines, minimumHorizontalScale, options);
}
//==============================================================================

View file

@ -220,7 +220,8 @@ public:
int x, int y, int width, int height,
Justification justificationFlags,
int maximumNumberOfLines,
float minimumHorizontalScale = 0.0f) const;
float minimumHorizontalScale = 0.0f,
GlyphArrangementOptions options = {}) const;
/** Tries to draw a text string inside a given space.
@ -245,7 +246,8 @@ public:
Rectangle<int> area,
Justification justificationFlags,
int maximumNumberOfLines,
float minimumHorizontalScale = 0.0f) const;
float minimumHorizontalScale = 0.0f,
GlyphArrangementOptions options = {}) const;
//==============================================================================
/** Fills the context's entire clip region with the current colour or brush.

View file

@ -242,7 +242,7 @@ static auto createFittedText (const Font& f,
Justification layout,
int maximumLines,
float minimumRelativeHorizontalScale,
detail::ShapedText::Options baseOptions = {})
detail::ShapedText::Options baseOptions)
{
using namespace detail;
@ -451,6 +451,13 @@ static auto createFittedText (const Font& f,
return candidate.shapedText;
}
static detail::ShapedText::Options withGlyphArrangementOptions (const detail::ShapedText::Options& opts,
const GlyphArrangementOptions& gaOpts)
{
return opts.withAdditiveLineSpacing (gaOpts.getLineSpacing())
.withLeading (gaOpts.getLineHeightMultiple());
}
void GlyphArrangement::addFittedText (const Font& f,
const String& text,
float x,
@ -459,9 +466,19 @@ void GlyphArrangement::addFittedText (const Font& f,
float height,
Justification layout,
int maximumLines,
float minimumHorizontalScale)
float minimumHorizontalScale,
GlyphArrangementOptions options)
{
const auto st = createFittedText (f, text, width, height, layout, maximumLines, minimumHorizontalScale);
using namespace detail;
const auto st = createFittedText (f,
text,
width,
height,
layout,
maximumLines,
minimumHorizontalScale,
withGlyphArrangementOptions (ShapedText::Options{}, options));
// ShapedText has the feature for visually truncating the last line, and createFittedText() uses
// it. Hence if it's only the last line that requires a larger width, ShapedText will take care
@ -481,7 +498,8 @@ void GlyphArrangement::addFittedText (const Font& f,
layout,
maximumLines,
minimumHorizontalScale,
detail::ShapedText::Options{}.withAllowBreakingInsideWord());
withGlyphArrangementOptions (ShapedText::Options{}.withAllowBreakingInsideWord(),
options));
addGlyphsFromShapedText (*this, stWithWordBreaks, x, y);
}

View file

@ -224,7 +224,8 @@ public:
float x, float y, float width, float height,
Justification layout,
int maximumLinesToUse,
float minimumHorizontalScale = 0.0f);
float minimumHorizontalScale = 0.0f,
GlyphArrangementOptions options = {});
/** Appends another glyph arrangement to this one. */
void addGlyphArrangement (const GlyphArrangement&);

View file

@ -0,0 +1,50 @@
/*
==============================================================================
This file is part of the JUCE framework.
Copyright (c) Raw Material Software Limited
JUCE is an open source framework subject to commercial or open source
licensing.
By downloading, installing, or using the JUCE framework, or combining the
JUCE framework with any other source code, object code, content or any other
copyrightable work, you agree to the terms of the JUCE End User Licence
Agreement, and all incorporated terms including the JUCE Privacy Policy and
the JUCE Website Terms of Service, as applicable, which will bind you. If you
do not agree to the terms of these agreements, we will not license the JUCE
framework to you, and you must discontinue the installation or download
process and cease use of the JUCE framework.
JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
JUCE Privacy Policy: https://juce.com/juce-privacy-policy
JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
Or:
You may also use this code under the terms of the AGPLv3:
https://www.gnu.org/licenses/agpl-3.0.en.html
THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
==============================================================================
*/
namespace juce
{
auto GlyphArrangementOptions::tie() const noexcept
{
return std::tie (lineSpacing, lineHeightMultiple);
}
bool GlyphArrangementOptions::operator== (const GlyphArrangementOptions& other) const { return tie() == other.tie(); }
bool GlyphArrangementOptions::operator!= (const GlyphArrangementOptions& other) const { return tie() != other.tie(); }
bool GlyphArrangementOptions::operator< (const GlyphArrangementOptions& other) const { return tie() < other.tie(); }
bool GlyphArrangementOptions::operator<= (const GlyphArrangementOptions& other) const { return tie() <= other.tie(); }
bool GlyphArrangementOptions::operator> (const GlyphArrangementOptions& other) const { return tie() > other.tie(); }
bool GlyphArrangementOptions::operator>= (const GlyphArrangementOptions& other) const { return tie() >= other.tie(); }
} // namespace juce

View file

@ -0,0 +1,95 @@
/*
==============================================================================
This file is part of the JUCE framework.
Copyright (c) Raw Material Software Limited
JUCE is an open source framework subject to commercial or open source
licensing.
By downloading, installing, or using the JUCE framework, or combining the
JUCE framework with any other source code, object code, content or any other
copyrightable work, you agree to the terms of the JUCE End User Licence
Agreement, and all incorporated terms including the JUCE Privacy Policy and
the JUCE Website Terms of Service, as applicable, which will bind you. If you
do not agree to the terms of these agreements, we will not license the JUCE
framework to you, and you must discontinue the installation or download
process and cease use of the JUCE framework.
JUCE End User Licence Agreement: https://juce.com/legal/juce-8-licence/
JUCE Privacy Policy: https://juce.com/juce-privacy-policy
JUCE Website Terms of Service: https://juce.com/juce-website-terms-of-service/
Or:
You may also use this code under the terms of the AGPLv3:
https://www.gnu.org/licenses/agpl-3.0.en.html
THE JUCE FRAMEWORK IS PROVIDED "AS IS" WITHOUT ANY WARRANTY, AND ALL
WARRANTIES, WHETHER EXPRESSED OR IMPLIED, INCLUDING WARRANTY OF
MERCHANTABILITY OR FITNESS FOR A PARTICULAR PURPOSE, ARE DISCLAIMED.
==============================================================================
*/
namespace juce
{
/** Options that can be used to affect the layout produced by GlyphArrangement::addFittedText.
@see GlyphArrangement::addFittedText
*/
class GlyphArrangementOptions
{
public:
/** We increment the distance between the baselines of subsequent lines with this value.
Line spacing is added below the line's descender, and doesn't affect the first line's
baseline.
The total distance between baselines is lineHeight * lineHeightMultiple + lineSpacing.
*/
[[nodiscard]] GlyphArrangementOptions withLineSpacing (float x) const
{
return withMember (*this, &GlyphArrangementOptions::lineSpacing, x);
}
/** We multiply the original distance between the baselines of subsequent lines with this value.
The line height multiple is applied to both the ascender and descender, hence it affects
the first line's baseline.
The total distance between baselines is lineHeight * lineHeightMultiple + lineSpacing.
*/
[[nodiscard]] GlyphArrangementOptions withLineHeightMultiple (float x) const
{
return withMember (*this, &GlyphArrangementOptions::lineHeightMultiple, x);
}
/** @see withLineSpacing() */
const auto& getLineSpacing() const { return lineSpacing; }
/** @see withLineHeightMultiple() */
const auto& getLineHeightMultiple() const { return lineHeightMultiple; }
/** Equality operator. */
[[nodiscard]] bool operator== (const GlyphArrangementOptions& other) const;
/** Inequality operator. */
[[nodiscard]] bool operator!= (const GlyphArrangementOptions& other) const;
/** Less-than operator. Allows GlyphArrangementOptions to be used as keys in a map. */
[[nodiscard]] bool operator< (const GlyphArrangementOptions& other) const;
/** Less-than-or-equal operator. */
[[nodiscard]] bool operator<= (const GlyphArrangementOptions& other) const;
/** Greater-than operator. */
[[nodiscard]] bool operator> (const GlyphArrangementOptions& other) const;
/** Greater-than-or-equal operator. */
[[nodiscard]] bool operator>= (const GlyphArrangementOptions& other) const;
private:
auto tie() const noexcept;
float lineSpacing = 0.0f;
float lineHeightMultiple = 1.0f;
};
} // namespace juce

View file

@ -199,6 +199,7 @@ extern "C"
#include "detail/juce_SimpleShapedText.cpp"
#include "detail/juce_JustifiedText.cpp"
#include "detail/juce_ShapedText.cpp"
#include "fonts/juce_GlyphArrangementOptions.cpp"
#include "fonts/juce_GlyphArrangement.cpp"
#include "fonts/juce_TextLayout.cpp"
#include "effects/juce_DropShadowEffect.cpp"

View file

@ -131,6 +131,7 @@ namespace juce
#include "images/juce_ImageCache.h"
#include "images/juce_ImageConvolutionKernel.h"
#include "images/juce_ImageFileFormat.h"
#include "fonts/juce_GlyphArrangementOptions.h"
#include "contexts/juce_GraphicsContext.h"
#include "images/juce_Image.h"
#include "colour/juce_FillType.h"