1
0
Fork 0
mirror of https://github.com/juce-framework/JUCE.git synced 2026-01-09 23:34:20 +00:00

Upgrade to harfbuzz 10.1.0

This commit is contained in:
attila 2024-12-09 15:32:28 +01:00
parent 9b73f07e07
commit 6f4a2f6b6a
95 changed files with 5746 additions and 4151 deletions

View file

@ -1610,7 +1610,8 @@ add_library( ${BINARY_NAME}
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-config.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-font.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-shape.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-cplusplus.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-debug.hh"
@ -4206,7 +4207,8 @@ set_source_files_properties(
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-config.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-font.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-shape.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-cplusplus.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-debug.hh"

View file

@ -1944,7 +1944,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -2713,7 +2713,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -1944,7 +1944,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -2713,7 +2713,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -1372,7 +1372,8 @@ add_library( ${BINARY_NAME}
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-config.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-font.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-shape.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-cplusplus.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-debug.hh"
@ -3628,7 +3629,8 @@ set_source_files_properties(
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-config.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-font.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-shape.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-cplusplus.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-debug.hh"

View file

@ -1637,7 +1637,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -2230,7 +2230,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -1502,7 +1502,8 @@ add_library( ${BINARY_NAME}
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-config.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-font.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-shape.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-cplusplus.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-debug.hh"
@ -3911,7 +3912,8 @@ set_source_files_properties(
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-config.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-font.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-shape.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-cplusplus.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-debug.hh"

View file

@ -1771,7 +1771,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -2437,7 +2437,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -1771,7 +1771,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -2437,7 +2437,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -1391,7 +1391,8 @@ add_library( ${BINARY_NAME}
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-config.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-font.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-shape.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-cplusplus.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-debug.hh"
@ -3727,7 +3728,8 @@ set_source_files_properties(
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-common.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-config.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-font.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext-shape.cc"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-coretext.h"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-cplusplus.hh"
"../../../../../modules/juce_graphics/fonts/harfbuzz/hb-debug.hh"

View file

@ -1658,7 +1658,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -2284,7 +2284,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -800,7 +800,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -1123,7 +1123,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -800,7 +800,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -1123,7 +1123,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -1779,7 +1779,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -2485,7 +2485,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -1779,7 +1779,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -2485,7 +2485,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -1657,7 +1657,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<ExcludedFromBuild>true</ExcludedFromBuild>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -2281,7 +2281,10 @@
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-common.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext.cc">
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-font.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-coretext-shape.cc">
<Filter>JUCE Modules\juce_graphics\fonts\harfbuzz</Filter>
</ClCompile>
<ClCompile Include="..\..\..\..\modules\juce_graphics\fonts\harfbuzz\hb-directwrite.cc">

View file

@ -2058,7 +2058,7 @@ struct delta_set_index_map_subset_plan_t
unsigned outer = (*var_idx) >> 16;
unsigned bit_count = (outer == 0) ? 1 : hb_bit_storage (outer);
outer_bit_count = hb_max (bit_count, outer_bit_count);
unsigned inner = (*var_idx) & 0xFFFF;
bit_count = (inner == 0) ? 1 : hb_bit_storage (inner);
inner_bit_count = hb_max (bit_count, inner_bit_count);
@ -2080,7 +2080,7 @@ struct COLR
bool has_v0_data () const { return numBaseGlyphs; }
bool has_v1_data () const
{
if (version != 1)
if (version < 1)
return false;
hb_barrier ();
@ -2180,7 +2180,7 @@ struct COLR
hb_set_t *variation_indices,
hb_set_t *delta_set_indices) const
{
if (version != 1) return;
if (version < 1) return;
hb_barrier ();
hb_set_t visited_glyphs;
@ -2222,16 +2222,22 @@ struct COLR
{ return (this+baseGlyphList); }
bool has_var_store () const
{ return version >= 1 && varStore != 0; }
{ return version >= 1 && hb_barrier () && varStore != 0; }
bool has_delta_set_index_map () const
{ return version >= 1 && varIdxMap != 0; }
{ return version >= 1 && hb_barrier () && varIdxMap != 0; }
bool has_clip_list () const
{ return version >= 1 && hb_barrier () && clipList != 0; }
const DeltaSetIndexMap &get_delta_set_index_map () const
{ return (version == 0 || varIdxMap == 0) ? Null (DeltaSetIndexMap) : this+varIdxMap; }
{ return has_delta_set_index_map () && hb_barrier () ? this+varIdxMap : Null (DeltaSetIndexMap); }
const ItemVariationStore &get_var_store () const
{ return (version == 0 || varStore == 0) ? Null (ItemVariationStore) : this+varStore; }
{ return has_var_store () && hb_barrier () ? this+varStore : Null (ItemVariationStore); }
const ClipList &get_clip_list () const
{ return has_clip_list () && hb_barrier () ? this+clipList : Null (ClipList); }
bool sanitize (hb_sanitize_context_t *c) const
{
@ -2242,7 +2248,6 @@ struct COLR
(this+layersZ).sanitize (c, numLayers) &&
(version == 0 ||
(hb_barrier () &&
version == 1 &&
baseGlyphList.sanitize (c, this) &&
layerList.sanitize (c, this) &&
clipList.sanitize (c, this) &&
@ -2339,7 +2344,11 @@ struct COLR
c->plan->colrv1_varstore_inner_maps.as_array ()))
return_trace (false);
if (!out->varStore.serialize_serialize (c->serializer,
/* do not serialize varStore if there's no variation data after
* instancing: region_list or var_data is empty */
if (item_vars.get_region_list () &&
item_vars.get_vardata_encodings () &&
!out->varStore.serialize_serialize (c->serializer,
item_vars.has_long_word (),
c->plan->axis_tags,
item_vars.get_region_list (),
@ -2347,7 +2356,9 @@ struct COLR
return_trace (false);
/* if varstore is optimized, update colrv1_new_deltaset_idx_varidx_map in
* subset plan */
* subset plan.
* If varstore is empty after instancing, varidx_map would be empty and
* all var_idxes will be updated to VarIdx::NO_VARIATION */
if (optimize)
{
const hb_map_t &varidx_map = item_vars.get_varidx_map ();
@ -2459,7 +2470,9 @@ struct COLR
if (unlikely (!c->serializer->extend_min (colr_prime))) return_trace (false);
if (version == 0 || downgrade_to_V0 (glyphset))
return_trace (colr_prime->serialize_V0 (c->serializer, 0, base_it, layer_it));
return_trace (colr_prime->serialize_V0 (c->serializer, 0, base_it, layer_it));
hb_barrier ();
//start version 1
if (!c->serializer->allocate_size<void> (5 * HBUINT32::static_size)) return_trace (false);
@ -2469,8 +2482,8 @@ struct COLR
* after instancing */
if (!subset_varstore (c, colr_prime)) return_trace (false);
ItemVarStoreInstancer instancer (varStore ? &(this+varStore) : nullptr,
varIdxMap ? &(this+varIdxMap) : nullptr,
ItemVarStoreInstancer instancer (&(get_var_store ()),
&(get_delta_set_index_map ()),
c->plan->normalized_coords.as_array ());
if (!colr_prime->baseGlyphList.serialize_subset (c, baseGlyphList, this, instancer))
@ -2499,12 +2512,10 @@ struct COLR
bool
get_extents (hb_font_t *font, hb_codepoint_t glyph, hb_glyph_extents_t *extents) const
{
if (version != 1)
return false;
ItemVarStoreInstancer instancer (&(this+varStore),
&(this+varIdxMap),
hb_array (font->coords, font->num_coords));
ItemVarStoreInstancer instancer (&(get_var_store ()),
&(get_delta_set_index_map ()),
hb_array (font->coords, font->num_coords));
if (get_clip (glyph, extents, instancer))
{
@ -2539,7 +2550,7 @@ struct COLR
bool
has_paint_for_glyph (hb_codepoint_t glyph) const
{
if (version == 1)
if (version >= 1)
{
hb_barrier ();
@ -2555,7 +2566,7 @@ struct COLR
hb_glyph_extents_t *extents,
const ItemVarStoreInstancer instancer) const
{
return (this+clipList).get_extents (glyph,
return get_clip_list ().get_extents (glyph,
extents,
instancer);
}
@ -2564,13 +2575,13 @@ struct COLR
bool
paint_glyph (hb_font_t *font, hb_codepoint_t glyph, hb_paint_funcs_t *funcs, void *data, unsigned int palette_index, hb_color_t foreground, bool clip = true) const
{
ItemVarStoreInstancer instancer (&(this+varStore),
&(this+varIdxMap),
ItemVarStoreInstancer instancer (&(get_var_store ()),
&(get_delta_set_index_map ()),
hb_array (font->coords, font->num_coords));
hb_paint_context_t c (this, funcs, data, font, palette_index, foreground, instancer);
c.current_glyphs.add (glyph);
if (version == 1)
if (version >= 1)
{
hb_barrier ();

View file

@ -633,8 +633,8 @@ struct GDEFVersion1_2
ligCaretList.sanitize (c, this) &&
markAttachClassDef.sanitize (c, this) &&
hb_barrier () &&
(version.to_int () < 0x00010002u || markGlyphSetsDef.sanitize (c, this)) &&
(version.to_int () < 0x00010003u || varStore.sanitize (c, this)));
((version.to_int () < 0x00010002u && hb_barrier ()) || markGlyphSetsDef.sanitize (c, this)) &&
((version.to_int () < 0x00010003u && hb_barrier ()) || varStore.sanitize (c, this)));
}
static void remap_varidx_after_instantiation (const hb_map_t& varidx_map,
@ -668,13 +668,13 @@ struct GDEFVersion1_2
// the end of the GDEF table.
// See: https://github.com/harfbuzz/harfbuzz/issues/4636
auto snapshot_version0 = c->serializer->snapshot ();
if (unlikely (version.to_int () >= 0x00010002u && !c->serializer->embed (markGlyphSetsDef)))
if (unlikely (version.to_int () >= 0x00010002u && hb_barrier () && !c->serializer->embed (markGlyphSetsDef)))
return_trace (false);
bool subset_varstore = false;
unsigned varstore_index = (unsigned) -1;
auto snapshot_version2 = c->serializer->snapshot ();
if (version.to_int () >= 0x00010003u)
if (version.to_int () >= 0x00010003u && hb_barrier ())
{
if (unlikely (!c->serializer->embed (varStore))) return_trace (false);
if (c->plan->all_axes_pinned)
@ -712,7 +712,7 @@ struct GDEFVersion1_2
}
bool subset_markglyphsetsdef = false;
if (version.to_int () >= 0x00010002u)
if (version.to_int () >= 0x00010002u && hb_barrier ())
{
subset_markglyphsetsdef = out->markGlyphSetsDef.serialize_subset (c, markGlyphSetsDef, this);
}
@ -875,7 +875,7 @@ struct GDEF
bool has_mark_glyph_sets () const
{
switch (u.version.major) {
case 1: return u.version.to_int () >= 0x00010002u && u.version1.markGlyphSetsDef != 0;
case 1: return u.version.to_int () >= 0x00010002u && hb_barrier () && u.version1.markGlyphSetsDef != 0;
#ifndef HB_NO_BEYOND_64K
case 2: return u.version2.markGlyphSetsDef != 0;
#endif
@ -885,7 +885,7 @@ struct GDEF
const MarkGlyphSets &get_mark_glyph_sets () const
{
switch (u.version.major) {
case 1: return u.version.to_int () >= 0x00010002u ? this+u.version1.markGlyphSetsDef : Null(MarkGlyphSets);
case 1: return u.version.to_int () >= 0x00010002u && hb_barrier () ? this+u.version1.markGlyphSetsDef : Null(MarkGlyphSets);
#ifndef HB_NO_BEYOND_64K
case 2: return this+u.version2.markGlyphSetsDef;
#endif
@ -895,7 +895,7 @@ struct GDEF
bool has_var_store () const
{
switch (u.version.major) {
case 1: return u.version.to_int () >= 0x00010003u && u.version1.varStore != 0;
case 1: return u.version.to_int () >= 0x00010003u && hb_barrier () && u.version1.varStore != 0;
#ifndef HB_NO_BEYOND_64K
case 2: return u.version2.varStore != 0;
#endif
@ -905,7 +905,7 @@ struct GDEF
const ItemVariationStore &get_var_store () const
{
switch (u.version.major) {
case 1: return u.version.to_int () >= 0x00010003u ? this+u.version1.varStore : Null(ItemVariationStore);
case 1: return u.version.to_int () >= 0x00010003u && hb_barrier () ? this+u.version1.varStore : Null(ItemVariationStore);
#ifndef HB_NO_BEYOND_64K
case 2: return this+u.version2.varStore;
#endif

View file

@ -139,14 +139,8 @@ struct PairPosFormat2_4 : ValueBase
return_trace (false);
}
unsigned int klass2 = (this+classDef2).get_class (buffer->info[skippy_iter.idx].codepoint);
if (!klass2)
{
buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1);
return_trace (false);
}
unsigned int klass1 = (this+classDef1).get_class (buffer->cur().codepoint);
unsigned int klass2 = (this+classDef2).get_class (buffer->info[skippy_iter.idx].codepoint);
if (unlikely (klass1 >= class1Count || klass2 >= class2Count))
{
buffer->unsafe_to_concat (buffer->idx, skippy_iter.idx + 1);

View file

@ -6,7 +6,8 @@
#include "hb-buffer-verify.cc"
#include "hb-buffer.cc"
#include "hb-common.cc"
#include "hb-coretext.cc"
#include "hb-coretext-font.cc"
#include "hb-coretext-shape.cc"
#include "hb-directwrite.cc"
#include "hb-draw.cc"
#include "hb-face-builder.cc"

View file

@ -468,11 +468,11 @@ struct Lookup
const T* get_value (hb_codepoint_t glyph_id, unsigned int num_glyphs) const
{
switch (u.format) {
case 0: return u.format0.get_value (glyph_id, num_glyphs);
case 2: return u.format2.get_value (glyph_id);
case 4: return u.format4.get_value (glyph_id);
case 6: return u.format6.get_value (glyph_id);
case 8: return u.format8.get_value (glyph_id);
case 0: hb_barrier (); return u.format0.get_value (glyph_id, num_glyphs);
case 2: hb_barrier (); return u.format2.get_value (glyph_id);
case 4: hb_barrier (); return u.format4.get_value (glyph_id);
case 6: hb_barrier (); return u.format6.get_value (glyph_id);
case 8: hb_barrier (); return u.format8.get_value (glyph_id);
default:return nullptr;
}
}
@ -481,7 +481,7 @@ struct Lookup
{
switch (u.format) {
/* Format 10 cannot return a pointer. */
case 10: return u.format10.get_value_or_null (glyph_id);
case 10: hb_barrier (); return u.format10.get_value_or_null (glyph_id);
default:
const T *v = get_value (glyph_id, num_glyphs);
return v ? *v : Null (T);
@ -492,12 +492,12 @@ struct Lookup
void collect_glyphs (set_t &glyphs, unsigned int num_glyphs) const
{
switch (u.format) {
case 0: u.format0.collect_glyphs (glyphs, num_glyphs); return;
case 2: u.format2.collect_glyphs (glyphs); return;
case 4: u.format4.collect_glyphs (glyphs); return;
case 6: u.format6.collect_glyphs (glyphs); return;
case 8: u.format8.collect_glyphs (glyphs); return;
case 10: u.format10.collect_glyphs (glyphs); return;
case 0: hb_barrier (); u.format0.collect_glyphs (glyphs, num_glyphs); return;
case 2: hb_barrier (); u.format2.collect_glyphs (glyphs); return;
case 4: hb_barrier (); u.format4.collect_glyphs (glyphs); return;
case 6: hb_barrier (); u.format6.collect_glyphs (glyphs); return;
case 8: hb_barrier (); u.format8.collect_glyphs (glyphs); return;
case 10: hb_barrier (); u.format10.collect_glyphs (glyphs); return;
default:return;
}
}
@ -516,12 +516,12 @@ struct Lookup
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 0: return_trace (u.format0.sanitize (c));
case 2: return_trace (u.format2.sanitize (c));
case 4: return_trace (u.format4.sanitize (c));
case 6: return_trace (u.format6.sanitize (c));
case 8: return_trace (u.format8.sanitize (c));
case 10: return_trace (u.format10.sanitize (c));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c));
case 6: hb_barrier (); return_trace (u.format6.sanitize (c));
case 8: hb_barrier (); return_trace (u.format8.sanitize (c));
case 10: hb_barrier (); return_trace (u.format10.sanitize (c));
default:return_trace (true);
}
}
@ -531,11 +531,11 @@ struct Lookup
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 0: return_trace (u.format0.sanitize (c, base));
case 2: return_trace (u.format2.sanitize (c, base));
case 4: return_trace (u.format4.sanitize (c, base));
case 6: return_trace (u.format6.sanitize (c, base));
case 8: return_trace (u.format8.sanitize (c, base));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c, base));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c, base));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c, base));
case 6: hb_barrier (); return_trace (u.format6.sanitize (c, base));
case 8: hb_barrier (); return_trace (u.format8.sanitize (c, base));
case 10: return_trace (false); /* We don't support format10 here currently. */
default:return_trace (true);
}

View file

@ -189,12 +189,12 @@ struct ActionSubrecord
switch (u.header.actionType)
{
case 0: return_trace (u.decompositionAction.sanitize (c));
case 1: return_trace (u.unconditionalAddGlyphAction.sanitize (c));
case 2: return_trace (u.conditionalAddGlyphAction.sanitize (c));
// case 3: return_trace (u.stretchGlyphAction.sanitize (c));
case 4: return_trace (u.decompositionAction.sanitize (c));
case 5: return_trace (u.decompositionAction.sanitize (c));
case 0: hb_barrier (); return_trace (u.decompositionAction.sanitize (c));
case 1: hb_barrier (); return_trace (u.unconditionalAddGlyphAction.sanitize (c));
case 2: hb_barrier (); return_trace (u.conditionalAddGlyphAction.sanitize (c));
// case 3: hb_barrier (); return_trace (u.stretchGlyphAction.sanitize (c));
case 4: hb_barrier (); return_trace (u.decompositionAction.sanitize (c));
case 5: hb_barrier (); return_trace (u.decompositionAction.sanitize (c));
default: return_trace (true);
}
}

View file

@ -1062,7 +1062,8 @@ struct ChainSubtable
bool apply (hb_aat_apply_context_t *c) const
{
TRACE_APPLY (this);
hb_sanitize_with_object_t with (&c->sanitizer, this);
// Disabled for https://github.com/harfbuzz/harfbuzz/issues/4873
//hb_sanitize_with_object_t with (&c->sanitizer, this);
return_trace (dispatch (c));
}
@ -1075,7 +1076,8 @@ struct ChainSubtable
c->check_range (this, length)))
return_trace (false);
hb_sanitize_with_object_t with (c, this);
// Disabled for https://github.com/harfbuzz/harfbuzz/issues/4873
//hb_sanitize_with_object_t with (c, this);
return_trace (dispatch (c));
}

View file

@ -133,8 +133,8 @@ struct opbd
{
switch (format)
{
case 0: return u.format0.get_bounds (font, glyph_id, extents, this);
case 1: return u.format1.get_bounds (font, glyph_id, extents, this);
case 0: hb_barrier (); return u.format0.get_bounds (font, glyph_id, extents, this);
case 1: hb_barrier (); return u.format1.get_bounds (font, glyph_id, extents, this);
default:return false;
}
}
@ -148,8 +148,8 @@ struct opbd
switch (format)
{
case 0: return_trace (u.format0.sanitize (c, this));
case 1: return_trace (u.format1.sanitize (c, this));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c, this));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c, this));
default:return_trace (true);
}
}

View file

@ -617,10 +617,9 @@ hb_blob_create_from_file (const char *file_name)
/**
* hb_blob_create_from_file_or_fail:
* @file_name: A font filename
* @file_name: A filename
*
* Creates a new blob containing the data from the
* specified binary font file.
* Creates a new blob containing the data from the specified file.
*
* The filename is passed directly to the system on all platforms,
* except on Windows, where the filename is interpreted as UTF-8.

View file

@ -412,7 +412,7 @@ hb_buffer_t::verify (hb_buffer_t *text_buffer,
&len,
HB_BUFFER_SERIALIZE_FORMAT_TEXT,
HB_BUFFER_SERIALIZE_FLAG_NO_CLUSTERS);
buffer_verify_error (this, font, BUFFER_VERIFY_ERROR "text was: %s.", bytes.arrayZ);
buffer_verify_error (this, font, BUFFER_VERIFY_ERROR "text was: %s.", bytes.arrayZ ? bytes.arrayZ : "");
}
#endif
}

View file

@ -271,6 +271,7 @@ hb_buffer_t::similar (const hb_buffer_t &src)
replacement = src.replacement;
invisible = src.invisible;
not_found = src.not_found;
not_found_variation_selector = src.not_found_variation_selector;
}
void
@ -283,6 +284,7 @@ hb_buffer_t::reset ()
replacement = HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT;
invisible = 0;
not_found = 0;
not_found_variation_selector = HB_CODEPOINT_INVALID;
clear ();
}
@ -705,6 +707,7 @@ DEFINE_NULL_INSTANCE (hb_buffer_t) =
HB_BUFFER_REPLACEMENT_CODEPOINT_DEFAULT,
0, /* invisible */
0, /* not_found */
HB_CODEPOINT_INVALID, /* not_found_variation_selector */
HB_BUFFER_CONTENT_TYPE_INVALID,
@ -1360,6 +1363,46 @@ hb_buffer_get_not_found_glyph (const hb_buffer_t *buffer)
return buffer->not_found;
}
/**
* hb_buffer_set_not_found_variation_selector_glyph:
* @buffer: An #hb_buffer_t
* @not_found_variation_selector: the not-found-variation-selector #hb_codepoint_t
*
* Sets the #hb_codepoint_t that replaces variation-selector characters not resolved
* in the font during shaping.
*
* The not-found-variation-selector glyph defaults to #HB_CODEPOINT_INVALID,
* in which case an unresolved variation-selector will be removed from the glyph
* string during shaping. This API allows for changing that and retaining a glyph,
* such that the situation can be detected by the client and handled accordingly
* (e.g. by using a different font).
*
* Since: 10.0.0
**/
void
hb_buffer_set_not_found_variation_selector_glyph (hb_buffer_t *buffer,
hb_codepoint_t not_found_variation_selector)
{
buffer->not_found_variation_selector = not_found_variation_selector;
}
/**
* hb_buffer_get_not_found_variation_selector_glyph:
* @buffer: An #hb_buffer_t
*
* See hb_buffer_set_not_found_variation_selector_glyph().
*
* Return value:
* The @buffer not-found-variation-selector #hb_codepoint_t
*
* Since: 10.0.0
**/
hb_codepoint_t
hb_buffer_get_not_found_variation_selector_glyph (const hb_buffer_t *buffer)
{
return buffer->not_found_variation_selector;
}
/**
* hb_buffer_set_random_state:
* @buffer: An #hb_buffer_t

View file

@ -487,6 +487,13 @@ hb_buffer_set_not_found_glyph (hb_buffer_t *buffer,
HB_EXTERN hb_codepoint_t
hb_buffer_get_not_found_glyph (const hb_buffer_t *buffer);
HB_EXTERN void
hb_buffer_set_not_found_variation_selector_glyph (hb_buffer_t *buffer,
hb_codepoint_t not_found_variation_selector);
HB_EXTERN hb_codepoint_t
hb_buffer_get_not_found_variation_selector_glyph (const hb_buffer_t *buffer);
HB_EXTERN void
hb_buffer_set_random_state (hb_buffer_t *buffer,
unsigned state);

View file

@ -52,6 +52,7 @@ enum hb_buffer_scratch_flags_t {
HB_BUFFER_SCRATCH_FLAG_HAS_CGJ = 0x00000010u,
HB_BUFFER_SCRATCH_FLAG_HAS_GLYPH_FLAGS = 0x00000020u,
HB_BUFFER_SCRATCH_FLAG_HAS_BROKEN_SYLLABLE = 0x00000040u,
HB_BUFFER_SCRATCH_FLAG_HAS_VARIATION_SELECTOR_FALLBACK= 0x00000080u,
/* Reserved for shapers' internal use. */
HB_BUFFER_SCRATCH_FLAG_SHAPER0 = 0x01000000u,
@ -80,6 +81,7 @@ struct hb_buffer_t
hb_codepoint_t replacement; /* U+FFFD or something else. */
hb_codepoint_t invisible; /* 0 or something else. */
hb_codepoint_t not_found; /* 0 or something else. */
hb_codepoint_t not_found_variation_selector; /* HB_CODEPOINT_INVALID or something else. */
/*
* Buffer contents

View file

@ -84,7 +84,7 @@ struct dict_opset_t : opset_t<number_t>
enum Nibble { DECIMAL=10, EXP_POS, EXP_NEG, RESERVED, NEG, END };
char buf[32];
char buf[32] = {0};
unsigned char byte = 0;
for (unsigned i = 0, count = 0; count < ARRAY_LENGTH (buf); ++i, ++count)
{

View file

@ -504,6 +504,13 @@ hb_language_matches (hb_language_t language,
* @HB_SCRIPT_MATH: `Zmth`, Since: 3.4.0
* @HB_SCRIPT_KAWI: `Kawi`, Since: 5.2.0
* @HB_SCRIPT_NAG_MUNDARI: `Nagm`, Since: 5.2.0
* @HB_SCRIPT_GARAY: `Gara`, Since: 10.0.0
* @HB_SCRIPT_GURUNG_KHEMA: `Gukh`, Since: 10.0.0
* @HB_SCRIPT_KIRAT_RAI: `Krai`, Since: 10.0.0
* @HB_SCRIPT_OL_ONAL: `Onao`, Since: 10.0.0
* @HB_SCRIPT_SUNUWAR: `Sunu`, Since: 10.0.0
* @HB_SCRIPT_TODHRI: `Todr`, Since: 10.0.0
* @HB_SCRIPT_TULU_TIGALARI: `Tutg`, Since: 10.0.0
* @HB_SCRIPT_INVALID: No script set
*
* Data type for scripts. Each #hb_script_t's value is an #hb_tag_t corresponding
@ -731,6 +738,17 @@ typedef enum
HB_SCRIPT_KAWI = HB_TAG ('K','a','w','i'), /*15.0*/
HB_SCRIPT_NAG_MUNDARI = HB_TAG ('N','a','g','m'), /*15.0*/
/*
* Since 10.0.0
*/
HB_SCRIPT_GARAY = HB_TAG ('G','a','r','a'), /*16.0*/
HB_SCRIPT_GURUNG_KHEMA = HB_TAG ('G','u','k','h'), /*16.0*/
HB_SCRIPT_KIRAT_RAI = HB_TAG ('K','r','a','i'), /*16.0*/
HB_SCRIPT_OL_ONAL = HB_TAG ('O','n','a','o'), /*16.0*/
HB_SCRIPT_SUNUWAR = HB_TAG ('S','u','n','u'), /*16.0*/
HB_SCRIPT_TODHRI = HB_TAG ('T','o','d','r'), /*16.0*/
HB_SCRIPT_TULU_TIGALARI = HB_TAG ('T','u','t','g'), /*16.0*/
/* No script set. */
HB_SCRIPT_INVALID = HB_TAG_NONE,

View file

@ -56,7 +56,6 @@
#ifdef HB_LEAN
#define HB_DISABLE_DEPRECATED
#define HB_NDEBUG
#define HB_NO_ATEXIT
#define HB_NO_BUFFER_MESSAGE
#define HB_NO_BUFFER_SERIALIZE

View file

@ -0,0 +1,461 @@
/*
* Copyright © 2024 Google, Inc.
*
* This is part of HarfBuzz, a text shaping library.
*
* Permission is hereby granted, without written agreement and without
* license or royalty fees, to use, copy, modify, and distribute this
* software and its documentation for any purpose, provided that the
* above copyright notice and the following two paragraphs appear in
* all copies of this software.
*
* IN NO EVENT SHALL THE COPYRIGHT HOLDER BE LIABLE TO ANY PARTY FOR
* DIRECT, INDIRECT, SPECIAL, INCIDENTAL, OR CONSEQUENTIAL DAMAGES
* ARISING OUT OF THE USE OF THIS SOFTWARE AND ITS DOCUMENTATION, EVEN
* IF THE COPYRIGHT HOLDER HAS BEEN ADVISED OF THE POSSIBILITY OF SUCH
* DAMAGE.
*
* THE COPYRIGHT HOLDER SPECIFICALLY DISCLAIMS ANY WARRANTIES, INCLUDING,
* BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
* FITNESS FOR A PARTICULAR PURPOSE. THE SOFTWARE PROVIDED HEREUNDER IS
* ON AN "AS IS" BASIS, AND THE COPYRIGHT HOLDER HAS NO OBLIGATION TO
* PROVIDE MAINTENANCE, SUPPORT, UPDATES, ENHANCEMENTS, OR MODIFICATIONS.
*
* Author(s): Behdad Esfahbod
*/
#include "hb.hh"
#ifdef HAVE_CORETEXT
#include "hb-coretext.h"
#include "hb-draw.hh"
#include "hb-font.hh"
#include "hb-machinery.hh"
#if MAC_OS_X_VERSION_MIN_REQUIRED < 101100
# define kCTFontOrientationDefault kCTFontDefaultOrientation
#endif
#define MAX_GLYPHS 64u
static void
_hb_coretext_font_destroy (void *font_data)
{
CTFontRef ct_font = (CTFontRef) font_data;
CFRelease (ct_font);
}
static hb_bool_t
hb_coretext_get_nominal_glyph (hb_font_t *font HB_UNUSED,
void *font_data,
hb_codepoint_t unicode,
hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
CTFontRef ct_font = (CTFontRef) font_data;
UniChar ch = unicode;
CGGlyph cg_glyph;
if (CTFontGetGlyphsForCharacters (ct_font, &ch, &cg_glyph, 1))
{
*glyph = cg_glyph;
return true;
}
return false;
}
static unsigned int
hb_coretext_get_nominal_glyphs (hb_font_t *font HB_UNUSED,
void *font_data,
unsigned int count,
const hb_codepoint_t *first_unicode,
unsigned int unicode_stride,
hb_codepoint_t *first_glyph,
unsigned int glyph_stride,
void *user_data HB_UNUSED)
{
CTFontRef ct_font = (CTFontRef) font_data;
UniChar ch[MAX_GLYPHS];
CGGlyph cg_glyph[MAX_GLYPHS];
for (unsigned i = 0; i < count; i += MAX_GLYPHS)
{
unsigned c = (unsigned) hb_min ((int) MAX_GLYPHS, (int) count - (int) i);
for (unsigned j = 0; j < c; j++)
{
ch[j] = *first_unicode;
first_unicode = &StructAtOffset<const hb_codepoint_t> (first_unicode, unicode_stride);
}
CTFontGetGlyphsForCharacters (ct_font, ch, cg_glyph, c);
for (unsigned j = 0; j < c; j++)
{
*first_glyph = cg_glyph[j];
first_glyph = &StructAtOffset<hb_codepoint_t> (first_glyph, glyph_stride);
}
}
return count;
}
static hb_bool_t
hb_coretext_get_variation_glyph (hb_font_t *font HB_UNUSED,
void *font_data,
hb_codepoint_t unicode,
hb_codepoint_t variation_selector,
hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
CTFontRef ct_font = (CTFontRef) font_data;
UniChar ch[2] = { unicode, variation_selector };
CGGlyph cg_glyph[2];
CTFontGetGlyphsForCharacters (ct_font, ch, cg_glyph, 2);
if (cg_glyph[1])
return false;
*glyph = cg_glyph[0];
return true;
}
static void
hb_coretext_get_glyph_h_advances (hb_font_t* font, void* font_data,
unsigned count,
const hb_codepoint_t *first_glyph,
unsigned glyph_stride,
hb_position_t *first_advance,
unsigned advance_stride,
void *user_data HB_UNUSED)
{
CTFontRef ct_font = (CTFontRef) font_data;
CGFloat ct_font_size = CTFontGetSize (ct_font);
CGFloat x_mult = (CGFloat) font->x_scale / ct_font_size;
CGGlyph cg_glyph[MAX_GLYPHS];
CGSize advances[MAX_GLYPHS];
for (unsigned i = 0; i < count; i += MAX_GLYPHS)
{
unsigned c = (unsigned) hb_min ((int) MAX_GLYPHS, (int) count - (int) i);
for (unsigned j = 0; j < c; j++)
{
cg_glyph[j] = *first_glyph;
first_glyph = &StructAtOffset<const hb_codepoint_t> (first_glyph, glyph_stride);
}
CTFontGetAdvancesForGlyphs (ct_font, kCTFontOrientationHorizontal, cg_glyph, advances, c);
for (unsigned j = 0; j < c; j++)
{
*first_advance = round (advances[j].width * x_mult);
first_advance = &StructAtOffset<hb_position_t> (first_advance, advance_stride);
}
}
}
#ifndef HB_NO_VERTICAL
static void
hb_coretext_get_glyph_v_advances (hb_font_t* font, void* font_data,
unsigned count,
const hb_codepoint_t *first_glyph,
unsigned glyph_stride,
hb_position_t *first_advance,
unsigned advance_stride,
void *user_data HB_UNUSED)
{
CTFontRef ct_font = (CTFontRef) font_data;
CGFloat ct_font_size = CTFontGetSize (ct_font);
CGFloat y_mult = (CGFloat) -font->y_scale / ct_font_size;
CGGlyph cg_glyph[MAX_GLYPHS];
CGSize advances[MAX_GLYPHS];
for (unsigned i = 0; i < count; i += MAX_GLYPHS)
{
unsigned c = (unsigned) hb_min ((int) MAX_GLYPHS, (int) count - (int) i);
for (unsigned j = 0; j < c; j++)
{
cg_glyph[j] = *first_glyph;
first_glyph = &StructAtOffset<const hb_codepoint_t> (first_glyph, glyph_stride);
}
CTFontGetAdvancesForGlyphs (ct_font, kCTFontOrientationVertical, cg_glyph, advances, c);
for (unsigned j = 0; j < c; j++)
{
*first_advance = round (advances[j].width * y_mult);
first_advance = &StructAtOffset<hb_position_t> (first_advance, advance_stride);
}
}
}
#endif
#ifndef HB_NO_VERTICAL
static hb_bool_t
hb_coretext_get_glyph_v_origin (hb_font_t *font,
void *font_data,
hb_codepoint_t glyph,
hb_position_t *x,
hb_position_t *y,
void *user_data HB_UNUSED)
{
CTFontRef ct_font = (CTFontRef) font_data;
CGFloat ct_font_size = CTFontGetSize (ct_font);
CGFloat x_mult = (CGFloat) -font->x_scale / ct_font_size;
CGFloat y_mult = (CGFloat) -font->y_scale / ct_font_size;
const CGGlyph glyphs = glyph;
CGSize origin;
CTFontGetVerticalTranslationsForGlyphs (ct_font, &glyphs, &origin, 1);
*x = round (x_mult * origin.width);
*y = round (y_mult * origin.height);
return true;
}
#endif
static hb_bool_t
hb_coretext_get_glyph_extents (hb_font_t *font,
void *font_data,
hb_codepoint_t glyph,
hb_glyph_extents_t *extents,
void *user_data HB_UNUSED)
{
CTFontRef ct_font = (CTFontRef) font_data;
CGFloat ct_font_size = CTFontGetSize (ct_font);
CGFloat x_mult = (CGFloat) font->x_scale / ct_font_size;
CGFloat y_mult = (CGFloat) font->y_scale / ct_font_size;
CGGlyph glyphs[1] = { glyph };
CGRect bounds = ::CTFontGetBoundingRectsForGlyphs(ct_font,
kCTFontOrientationDefault, glyphs, NULL, 1);
extents->x_bearing = round (bounds.origin.x * x_mult);
extents->y_bearing = round (bounds.origin.y * y_mult);
extents->width = round (bounds.size.width * x_mult);
extents->height = round (bounds.size.height * y_mult);
return true;
}
static hb_bool_t
hb_coretext_get_font_h_extents (hb_font_t *font,
void *font_data,
hb_font_extents_t *metrics,
void *user_data HB_UNUSED)
{
CTFontRef ct_font = (CTFontRef) font_data;
CGFloat ct_font_size = CTFontGetSize (ct_font);
CGFloat y_mult = (CGFloat) font->y_scale / ct_font_size;
metrics->ascender = round (CTFontGetAscent (ct_font) * y_mult);
metrics->descender = -round (CTFontGetDescent (ct_font) * y_mult);
metrics->line_gap = round (CTFontGetLeading (ct_font) * y_mult);
return true;
}
#ifndef HB_NO_DRAW
static void
ct_apply_func (void *info, const CGPathElement *element)
{
hb_draw_session_t *draws = (hb_draw_session_t *) info;
switch (element->type)
{
case kCGPathElementMoveToPoint:
draws->move_to (element->points[0].x, element->points[0].y);
break;
case kCGPathElementAddLineToPoint:
draws->line_to (element->points[0].x, element->points[0].y);
break;
case kCGPathElementAddQuadCurveToPoint:
draws->quadratic_to (element->points[0].x, element->points[0].y,
element->points[1].x, element->points[1].y);
break;
case kCGPathElementAddCurveToPoint:
draws->cubic_to (element->points[0].x, element->points[0].y,
element->points[1].x, element->points[1].y,
element->points[2].x, element->points[2].y);
break;
case kCGPathElementCloseSubpath:
draws->close_path ();
break;
}
}
static void
hb_coretext_draw_glyph (hb_font_t *font,
void *font_data HB_UNUSED,
hb_codepoint_t glyph,
hb_draw_funcs_t *draw_funcs, void *draw_data,
void *user_data)
{
CTFontRef ct_font = (CTFontRef) font_data;
CGFloat ct_font_size = CTFontGetSize (ct_font);
CGFloat x_mult = (CGFloat) font->x_scale / ct_font_size;
CGFloat y_mult = (CGFloat) font->y_scale / ct_font_size;
CGAffineTransform transform = CGAffineTransformIdentity;
transform = CGAffineTransformScale (transform, x_mult, y_mult);
CGPathRef path = CTFontCreatePathForGlyph (ct_font, glyph, &transform);
if (!path)
return;
hb_draw_session_t drawing = {draw_funcs, draw_data, font->slant};
CGPathApply (path, &drawing, ct_apply_func);
CFRelease (path);
}
#endif
static hb_bool_t
hb_coretext_get_glyph_name (hb_font_t *font,
void *font_data HB_UNUSED,
hb_codepoint_t glyph,
char *name, unsigned int size,
void *user_data HB_UNUSED)
{
CGFontRef cg_font = (CGFontRef) (const void *) font->face->data.coretext;
CGGlyph cg_glyph = glyph;
CFStringRef cf_name = CGFontCopyGlyphNameForGlyph (cg_font, cg_glyph);
if (!cf_name)
return false;
CFIndex len = CFStringGetLength (cf_name);
if (len > size - 1)
len = size - 1;
CFStringGetBytes (cf_name, CFRangeMake (0, len),
kCFStringEncodingUTF8, 0, false,
(UInt8 *) name, size, &len);
name[len] = '\0';
return true;
}
static hb_bool_t
hb_coretext_get_glyph_from_name (hb_font_t *font HB_UNUSED,
void *font_data,
const char *name, int len,
hb_codepoint_t *glyph,
void *user_data HB_UNUSED)
{
CTFontRef ct_font = (CTFontRef) font_data;
if (len == -1)
len = strlen (name);
CFStringRef cf_name = CFStringCreateWithBytes (kCFAllocatorDefault,
(const UInt8 *) name, len,
kCFStringEncodingUTF8, false);
CGGlyph cg_glyph = CTFontGetGlyphWithName (ct_font, cf_name);
*glyph = cg_glyph;
CFRelease (cf_name);
// TODO Return true for .notdef; hb-ft does that.
return cg_glyph != 0;
}
static inline void free_static_coretext_funcs ();
static struct hb_coretext_font_funcs_lazy_loader_t : hb_font_funcs_lazy_loader_t<hb_coretext_font_funcs_lazy_loader_t>
{
static hb_font_funcs_t *create ()
{
hb_font_funcs_t *funcs = hb_font_funcs_create ();
hb_font_funcs_set_nominal_glyph_func (funcs, hb_coretext_get_nominal_glyph, nullptr, nullptr);
hb_font_funcs_set_nominal_glyphs_func (funcs, hb_coretext_get_nominal_glyphs, nullptr, nullptr);
hb_font_funcs_set_variation_glyph_func (funcs, hb_coretext_get_variation_glyph, nullptr, nullptr);
hb_font_funcs_set_font_h_extents_func (funcs, hb_coretext_get_font_h_extents, nullptr, nullptr);
hb_font_funcs_set_glyph_h_advances_func (funcs, hb_coretext_get_glyph_h_advances, nullptr, nullptr);
//hb_font_funcs_set_glyph_h_origin_func (funcs, hb_coretext_get_glyph_h_origin, nullptr, nullptr);
#ifndef HB_NO_VERTICAL
//hb_font_funcs_set_font_v_extents_func (funcs, hb_coretext_get_font_v_extents, nullptr, nullptr);
hb_font_funcs_set_glyph_v_advances_func (funcs, hb_coretext_get_glyph_v_advances, nullptr, nullptr);
hb_font_funcs_set_glyph_v_origin_func (funcs, hb_coretext_get_glyph_v_origin, nullptr, nullptr);
#endif
#ifndef HB_NO_DRAW
hb_font_funcs_set_draw_glyph_func (funcs, hb_coretext_draw_glyph, nullptr, nullptr);
#endif
hb_font_funcs_set_glyph_extents_func (funcs, hb_coretext_get_glyph_extents, nullptr, nullptr);
#ifndef HB_NO_OT_FONT_GLYPH_NAMES
hb_font_funcs_set_glyph_name_func (funcs, hb_coretext_get_glyph_name, nullptr, nullptr);
hb_font_funcs_set_glyph_from_name_func (funcs, hb_coretext_get_glyph_from_name, nullptr, nullptr);
#endif
hb_font_funcs_make_immutable (funcs);
hb_atexit (free_static_coretext_funcs);
return funcs;
}
} static_coretext_funcs;
static inline
void free_static_coretext_funcs ()
{
static_coretext_funcs.free_instance ();
}
static hb_font_funcs_t *
_hb_coretext_get_font_funcs ()
{
return static_coretext_funcs.get_unconst ();
}
/**
* hb_coretext_font_set_funcs:
* @font: #hb_font_t to work upon
*
* Configures the font-functions structure of the specified
* #hb_font_t font object to use CoreText font functions.
*
* In particular, you can use this function to configure an
* existing #hb_face_t face object for use with CoreText font
* functions even if that #hb_face_t face object was initially
* created with hb_face_create(), and therefore was not
* initially configured to use CoreText font functions.
*
* An #hb_font_t object created with hb_coretext_font_create()
* is preconfigured for CoreText font functions and does not
* require this function to be used.
*
* <note>Note: Internally, this function creates a CTFont.
* </note>
*
* Since: 10.1.0
**/
void
hb_coretext_font_set_funcs (hb_font_t *font)
{
CTFontRef ct_font = hb_coretext_font_get_ct_font (font);
if (unlikely (!ct_font))
return;
hb_font_set_funcs (font,
_hb_coretext_get_font_funcs (),
(void *) CFRetain (ct_font),
_hb_coretext_font_destroy);
}
#undef MAX_GLYPHS
#endif

View file

@ -48,6 +48,8 @@
/* https://developer.apple.com/documentation/coretext/1508745-ctfontcreatewithgraphicsfont */
#define HB_CORETEXT_DEFAULT_FONT_SIZE 12.f
static CTFontRef create_ct_font (CGFontRef cg_font, CGFloat font_size);
static void
release_table_data (void *user_data)
{
@ -76,6 +78,52 @@ _hb_cg_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data
release_table_data);
}
static unsigned
_hb_cg_get_table_tags (const hb_face_t *face HB_UNUSED,
unsigned int start_offset,
unsigned int *table_count,
hb_tag_t *table_tags,
void *user_data)
{
CGFontRef cg_font = reinterpret_cast<CGFontRef> (user_data);
CTFontRef ct_font = create_ct_font (cg_font, (CGFloat) HB_CORETEXT_DEFAULT_FONT_SIZE);
auto arr = CTFontCopyAvailableTables (ct_font, kCTFontTableOptionNoOptions);
unsigned population = (unsigned) CFArrayGetCount (arr);
unsigned end_offset;
if (!table_count)
goto done;
if (unlikely (start_offset >= population))
{
*table_count = 0;
goto done;
}
end_offset = start_offset + *table_count;
if (unlikely (end_offset < start_offset))
{
*table_count = 0;
goto done;
}
end_offset= hb_min (end_offset, (unsigned) population);
*table_count = end_offset - start_offset;
for (unsigned i = start_offset; i < end_offset; i++)
{
CTFontTableTag tag = (CTFontTableTag)(uintptr_t) CFArrayGetValueAtIndex (arr, i);
table_tags[i - start_offset] = tag;
}
done:
CFRelease (arr);
CFRelease (ct_font);
return population;
}
static void
_hb_cg_font_release (void *data)
{
@ -287,14 +335,75 @@ _hb_coretext_shaper_face_data_destroy (hb_coretext_face_data_t *data)
* Creates an #hb_face_t face object from the specified
* CGFontRef.
*
* Return value: the new #hb_face_t face object
* Return value: (transfer full): The new face object
*
* Since: 0.9.10
*/
hb_face_t *
hb_coretext_face_create (CGFontRef cg_font)
{
return hb_face_create_for_tables (_hb_cg_reference_table, CGFontRetain (cg_font), _hb_cg_font_release);
hb_face_t *face = hb_face_create_for_tables (_hb_cg_reference_table, CGFontRetain (cg_font), _hb_cg_font_release);
hb_face_set_get_table_tags_func (face, _hb_cg_get_table_tags, cg_font, nullptr);
return face;
}
/**
* hb_coretext_face_create_from_file_or_fail:
* @file_name: A font filename
* @index: The index of the face within the file
*
* Creates an #hb_face_t face object from the specified
* font file and face index.
*
* This is similar in functionality to hb_face_create_from_file_or_fail(),
* but uses the CoreText library for loading the font file.
*
* Return value: (transfer full): The new face object, or `NULL` if
* no face is found at the specified index or the file cannot be read.
*
* Since: 10.1.0
*/
hb_face_t *
hb_coretext_face_create_from_file_or_fail (const char *file_name,
unsigned int index)
{
auto url = CFURLCreateFromFileSystemRepresentation (nullptr,
(const UInt8 *) file_name,
strlen (file_name),
false);
if (unlikely (!url))
return nullptr;
auto ct_font_desc_array = CTFontManagerCreateFontDescriptorsFromURL (url);
if (unlikely (!ct_font_desc_array))
{
CFRelease (url);
return nullptr;
}
auto ct_font_desc = (CFArrayGetCount (ct_font_desc_array) > index) ?
(CTFontDescriptorRef) CFArrayGetValueAtIndex (ct_font_desc_array, index) : nullptr;
if (unlikely (!ct_font_desc))
{
CFRelease (ct_font_desc_array);
CFRelease (url);
return nullptr;
}
CFRelease (url);
auto ct_font = ct_font_desc ? CTFontCreateWithFontDescriptor (ct_font_desc, 0, nullptr) : nullptr;
CFRelease (ct_font_desc_array);
if (unlikely (!ct_font))
return nullptr;
auto cg_font = ct_font ? CTFontCopyGraphicsFont (ct_font, nullptr) : nullptr;
CFRelease (ct_font);
if (unlikely (!cg_font))
return nullptr;
hb_face_t *face = hb_coretext_face_create (cg_font);
if (unlikely (hb_face_is_immutable (face)))
return nullptr;
return face;
}
/**
@ -389,7 +498,12 @@ _hb_coretext_shaper_font_data_destroy (hb_coretext_font_data_t *data)
* Creates an #hb_font_t font object from the specified
* CTFontRef.
*
* Return value: the new #hb_font_t font object
* The created font uses the default font functions implemented
* navitely by HarfBuzz. If you want to use the CoreText font functions
* instead (rarely needed), you can do so by calling
* by hb_coretext_font_set_funcs().
*
* Return value: (transfer full): The new font object
*
* Since: 1.7.2
**/
@ -410,6 +524,9 @@ hb_coretext_font_create (CTFontRef ct_font)
/* Let there be dragons here... */
font->data.coretext.cmpexch (nullptr, (hb_coretext_font_data_t *) CFRetain (ct_font));
// https://github.com/harfbuzz/harfbuzz/pull/4895#issuecomment-2408471254
//hb_coretext_font_set_funcs (font);
return font;
}

View file

@ -44,9 +44,9 @@ HB_BEGIN_DECLS
* HB_CORETEXT_TAG_MORT:
*
* The #hb_tag_t tag for the `mort` (glyph metamorphosis) table,
* which holds AAT features.
* which holds AAT features.
*
* For more information, see
* For more information, see
* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6mort.html
*
**/
@ -56,7 +56,7 @@ HB_BEGIN_DECLS
* HB_CORETEXT_TAG_MORX:
*
* The #hb_tag_t tag for the `morx` (extended glyph metamorphosis)
* table, which holds AAT features.
* table, which holds AAT features.
*
* For more information, see
* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6morx.html
@ -68,9 +68,9 @@ HB_BEGIN_DECLS
* HB_CORETEXT_TAG_KERX:
*
* The #hb_tag_t tag for the `kerx` (extended kerning) table, which
* holds AAT kerning information.
* holds AAT kerning information.
*
* For more information, see
* For more information, see
* https://developer.apple.com/fonts/TrueType-Reference-Manual/RM06/Chap6kerx.html
*
**/
@ -80,6 +80,10 @@ HB_BEGIN_DECLS
HB_EXTERN hb_face_t *
hb_coretext_face_create (CGFontRef cg_font);
HB_EXTERN hb_face_t *
hb_coretext_face_create_from_file_or_fail (const char *file_name,
unsigned int index);
HB_EXTERN hb_font_t *
hb_coretext_font_create (CTFontRef ct_font);
@ -90,6 +94,9 @@ hb_coretext_face_get_cg_font (hb_face_t *face);
HB_EXTERN CTFontRef
hb_coretext_font_get_ct_font (hb_font_t *font);
HB_EXTERN void
hb_coretext_font_set_funcs (hb_font_t *font);
HB_END_DECLS

View file

@ -70,7 +70,7 @@ typedef struct hb_draw_state_t {
*
* The default #hb_draw_state_t at the start of glyph drawing.
*/
#define HB_DRAW_STATE_DEFAULT {0, 0.f, 0.f, 0.f, 0.f, {0.}, {0.}, {0.}}
#define HB_DRAW_STATE_DEFAULT {0, 0.f, 0.f, 0.f, 0.f, {0.}, {0.}, {0.}, {0.}, {0.}, {0.}, {0.}}
/**

View file

@ -42,7 +42,7 @@
struct face_table_info_t
{
hb_blob_t* data;
signed order;
unsigned order;
};
struct hb_face_builder_data_t
@ -153,6 +153,50 @@ _hb_face_builder_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void
return hb_blob_reference (data->tables[tag].data);
}
static unsigned
_hb_face_builder_get_table_tags (const hb_face_t *face HB_UNUSED,
unsigned int start_offset,
unsigned int *table_count,
hb_tag_t *table_tags,
void *user_data)
{
hb_face_builder_data_t *data = (hb_face_builder_data_t *) user_data;
unsigned population = data->tables.get_population ();
if (!table_count)
return population;
if (unlikely (start_offset >= population))
{
if (table_count)
*table_count = 0;
return population;
}
// Sort the tags.
hb_vector_t<hb_tag_t> sorted_tags;
data->tables.keys () | hb_sink (sorted_tags);
if (unlikely (sorted_tags.in_error ()))
{
// Not much to do...
}
sorted_tags.qsort ([] (const void* a, const void* b) {
return * (hb_tag_t *) a < * (hb_tag_t *) b ? -1 :
* (hb_tag_t *) a == * (hb_tag_t *) b ? 0 :
+1;
});
auto array = sorted_tags.as_array ().sub_array (start_offset, table_count);
auto out = hb_array (table_tags, *table_count);
+ array.iter ()
| hb_sink (out)
;
return population;
}
/**
* hb_face_builder_create:
@ -171,9 +215,16 @@ hb_face_builder_create ()
hb_face_builder_data_t *data = _hb_face_builder_data_create ();
if (unlikely (!data)) return hb_face_get_empty ();
return hb_face_create_for_tables (_hb_face_builder_reference_table,
data,
_hb_face_builder_data_destroy);
hb_face_t *face = hb_face_create_for_tables (_hb_face_builder_reference_table,
data,
_hb_face_builder_data_destroy);
hb_face_set_get_table_tags_func (face,
_hb_face_builder_get_table_tags,
data,
nullptr);
return face;
}
/**
@ -199,7 +250,7 @@ hb_face_builder_add_table (hb_face_t *face, hb_tag_t tag, hb_blob_t *blob)
hb_face_builder_data_t *data = (hb_face_builder_data_t *) face->user_data;
hb_blob_t* previous = data->tables.get (tag).data;
if (!data->tables.set (tag, face_table_info_t {hb_blob_reference (blob), -1}))
if (!data->tables.set (tag, face_table_info_t {hb_blob_reference (blob), (unsigned) -1}))
{
hb_blob_destroy (blob);
return false;

View file

@ -90,10 +90,6 @@ DEFINE_NULL_INSTANCE (hb_face_t) =
{
HB_OBJECT_HEADER_STATIC,
nullptr, /* reference_table_func */
nullptr, /* user_data */
nullptr, /* destroy */
0, /* index */
1000, /* upem */
0, /* num_glyphs */
@ -110,8 +106,9 @@ DEFINE_NULL_INSTANCE (hb_face_t) =
*
* Variant of hb_face_create(), built for those cases where it is more
* convenient to provide data for individual tables instead of the whole font
* data. With the caveat that hb_face_get_table_tags() does not currently work
* with faces created this way.
* data. With the caveat that hb_face_get_table_tags() would not work
* with faces created this way. You can address that by calling the
* hb_face_set_get_table_tags_func() function and setting the appropriate callback.
*
* Creates a new face object from the specified @user_data and @reference_table_func,
* with the @destroy callback.
@ -194,6 +191,22 @@ _hb_face_for_data_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void
return blob;
}
static unsigned
_hb_face_for_data_get_table_tags (const hb_face_t *face HB_UNUSED,
unsigned int start_offset,
unsigned int *table_count,
hb_tag_t *table_tags,
void *user_data)
{
hb_face_for_data_closure_t *data = (hb_face_for_data_closure_t *) user_data;
const OT::OpenTypeFontFile &ot_file = *data->blob->as<OT::OpenTypeFontFile> ();
const OT::OpenTypeFontFace &ot_face = ot_file.get_face (data->index);
return ot_face.get_table_tags (start_offset, table_count, table_tags);
}
/**
* hb_face_create:
* @blob: #hb_blob_t to work upon
@ -240,12 +253,71 @@ hb_face_create (hb_blob_t *blob,
face = hb_face_create_for_tables (_hb_face_for_data_reference_table,
closure,
_hb_face_for_data_closure_destroy);
hb_face_set_get_table_tags_func (face,
_hb_face_for_data_get_table_tags,
closure,
nullptr);
face->index = index;
return face;
}
/**
* hb_face_create_or_fail:
* @blob: #hb_blob_t to work upon
* @index: The index of the face within @blob
*
* Like hb_face_create(), but returns `NULL` if the blob data
* contains no usable font face at the specified index.
*
* Return value: (transfer full): The new face object, or `NULL` if
* no face is found at the specified index.
*
* Since: 10.1.0
**/
hb_face_t *
hb_face_create_or_fail (hb_blob_t *blob,
unsigned int index)
{
unsigned num_faces = hb_face_count (blob);
if (index >= num_faces)
return nullptr;
hb_face_t *face = hb_face_create (blob, index);
if (hb_object_is_immutable (face))
return nullptr;
return face;
}
/**
* hb_face_create_from_file_or_fail:
* @file_name: A font filename
* @index: The index of the face within the file
*
* A thin wrapper around hb_blob_create_from_file_or_fail()
* followed by hb_face_create_or_fail().
*
* Return value: (transfer full): The new face object, or `NULL` if
* no face is found at the specified index or the file cannot be read.
*
* Since: 10.1.0
**/
HB_EXTERN hb_face_t *
hb_face_create_from_file_or_fail (const char *file_name,
unsigned int index)
{
hb_blob_t *blob = hb_blob_create_from_file_or_fail (file_name);
if (unlikely (!blob))
return nullptr;
hb_face_t *face = hb_face_create_or_fail (blob, index);
hb_blob_destroy (blob);
return face;
}
/**
* hb_face_get_empty:
*
@ -306,6 +378,9 @@ hb_face_destroy (hb_face_t *face)
face->data.fini ();
face->table.fini ();
if (face->get_table_tags_destroy)
face->get_table_tags_destroy (face->get_table_tags_user_data);
if (face->destroy)
face->destroy (face->user_data);
@ -547,6 +622,37 @@ hb_face_get_glyph_count (const hb_face_t *face)
return face->get_num_glyphs ();
}
/**
* hb_face_set_get_table_tags_func:
* @face: A face object
* @func: (closure user_data) (destroy destroy) (scope notified): The table-tag-fetching function
* @user_data: A pointer to the user data, to be destroyed by @destroy when not needed anymore
* @destroy: (nullable): A callback to call when @func is not needed anymore
*
* Sets the table-tag-fetching function for the specified face object.
*
* Since: 10.0.0
*/
HB_EXTERN void
hb_face_set_get_table_tags_func (hb_face_t *face,
hb_get_table_tags_func_t func,
void *user_data,
hb_destroy_func_t destroy)
{
if (hb_object_is_immutable (face))
{
if (destroy)
destroy (user_data);
}
if (face->get_table_tags_destroy)
face->get_table_tags_destroy (face->get_table_tags_user_data);
face->get_table_tags_func = func;
face->get_table_tags_user_data = user_data;
face->get_table_tags_destroy = destroy;
}
/**
* hb_face_get_table_tags:
* @face: A face object
@ -568,19 +674,14 @@ hb_face_get_table_tags (const hb_face_t *face,
unsigned int *table_count, /* IN/OUT */
hb_tag_t *table_tags /* OUT */)
{
if (face->destroy != (hb_destroy_func_t) _hb_face_for_data_closure_destroy)
if (!face->get_table_tags_func)
{
if (table_count)
*table_count = 0;
return 0;
}
hb_face_for_data_closure_t *data = (hb_face_for_data_closure_t *) face->user_data;
const OT::OpenTypeFontFile &ot_file = *data->blob->as<OT::OpenTypeFontFile> ();
const OT::OpenTypeFontFace &ot_face = ot_file.get_face (data->index);
return ot_face.get_table_tags (start_offset, table_count, table_tags);
return face->get_table_tags_func (face, start_offset, table_count, table_tags, face->get_table_tags_user_data);
}

View file

@ -59,6 +59,14 @@ HB_EXTERN hb_face_t *
hb_face_create (hb_blob_t *blob,
unsigned int index);
HB_EXTERN hb_face_t *
hb_face_create_or_fail (hb_blob_t *blob,
unsigned int index);
HB_EXTERN hb_face_t *
hb_face_create_from_file_or_fail (const char *file_name,
unsigned int index);
/**
* hb_reference_table_func_t:
* @face: an #hb_face_t to reference table for
@ -135,6 +143,34 @@ hb_face_set_glyph_count (hb_face_t *face,
HB_EXTERN unsigned int
hb_face_get_glyph_count (const hb_face_t *face);
/**
* hb_get_table_tags_func_t:
* @face: A face object
* @start_offset: The index of first table tag to retrieve
* @table_count: (inout): Input = the maximum number of table tags to return;
* Output = the actual number of table tags returned (may be zero)
* @table_tags: (out) (array length=table_count): The array of table tags found
* @user_data: User data pointer passed by the caller
*
* Callback function for hb_face_get_table_tags().
*
* Return value: Total number of tables, or zero if it is not possible to list
*
* Since: 10.0.0
*/
typedef unsigned int (*hb_get_table_tags_func_t) (const hb_face_t *face,
unsigned int start_offset,
unsigned int *table_count, /* IN/OUT */
hb_tag_t *table_tags /* OUT */,
void *user_data);
HB_EXTERN void
hb_face_set_get_table_tags_func (hb_face_t *face,
hb_get_table_tags_func_t func,
void *user_data,
hb_destroy_func_t destroy);
HB_EXTERN unsigned int
hb_face_get_table_tags (const hb_face_t *face,
unsigned int start_offset,

View file

@ -48,13 +48,17 @@ struct hb_face_t
{
hb_object_header_t header;
unsigned int index; /* Face index in a collection, zero-based. */
mutable hb_atomic_int_t upem; /* Units-per-EM. */
mutable hb_atomic_int_t num_glyphs; /* Number of glyphs. */
hb_reference_table_func_t reference_table_func;
void *user_data;
hb_destroy_func_t destroy;
unsigned int index; /* Face index in a collection, zero-based. */
mutable hb_atomic_int_t upem; /* Units-per-EM. */
mutable hb_atomic_int_t num_glyphs; /* Number of glyphs. */
hb_get_table_tags_func_t get_table_tags_func;
void *get_table_tags_user_data;
hb_destroy_func_t get_table_tags_destroy;
hb_shaper_object_dataset_t<hb_face_t> data;/* Various shaper data. */
hb_ot_face_t table; /* All the face's tables. */

View file

@ -231,7 +231,7 @@ hb_font_get_glyph_v_advance_nil (hb_font_t *font,
void *user_data HB_UNUSED)
{
/* TODO use font_extents.ascender+descender */
return font->y_scale;
return -font->y_scale;
}
static hb_position_t

View file

@ -41,6 +41,7 @@
#include "hb-ot-shaper-arabic-pua.hh"
#include "hb-paint.hh"
#include FT_MODULE_H
#include FT_ADVANCES_H
#include FT_MULTIPLE_MASTERS_H
#include FT_OUTLINE_H
@ -1104,6 +1105,45 @@ _hb_ft_reference_table (hb_face_t *face HB_UNUSED, hb_tag_t tag, void *user_data
buffer, hb_free);
}
static unsigned
_hb_ft_get_table_tags (const hb_face_t *face HB_UNUSED,
unsigned int start_offset,
unsigned int *table_count,
hb_tag_t *table_tags,
void *user_data)
{
FT_Face ft_face = (FT_Face) user_data;
FT_ULong population = 0;
FT_Sfnt_Table_Info (ft_face,
0, // table_index; ignored
nullptr,
&population);
if (!table_count)
return population;
else
*table_count = 0;
if (unlikely (start_offset >= population))
return population;
unsigned end_offset = hb_min (start_offset + *table_count, (unsigned) population);
if (unlikely (end_offset < start_offset))
return population;
*table_count = end_offset - start_offset;
for (unsigned i = start_offset; i < end_offset; i++)
{
FT_ULong tag = 0, length;
FT_Sfnt_Table_Info (ft_face, i, &tag, &length);
table_tags[i - start_offset] = tag;
}
return population;
}
/**
* hb_ft_face_create:
* @ft_face: (destroy destroy) (scope notified): FT_Face to work upon
@ -1145,6 +1185,7 @@ hb_ft_face_create (FT_Face ft_face,
hb_blob_destroy (blob);
} else {
face = hb_face_create_for_tables (_hb_ft_reference_table, ft_face, destroy);
hb_face_set_get_table_tags_func (face, _hb_ft_get_table_tags, ft_face, nullptr);
}
hb_face_set_index (face, ft_face->face_index);
@ -1392,6 +1433,24 @@ hb_ft_font_create_referenced (FT_Face ft_face)
return hb_ft_font_create (ft_face, _hb_ft_face_destroy);
}
static void * _hb_ft_alloc (FT_Memory memory, long size)
{ return hb_malloc (size); }
static void _hb_ft_free (FT_Memory memory, void *block)
{ hb_free (block); }
static void * _hb_ft_realloc (FT_Memory memory, long cur_size, long new_size, void *block)
{ return hb_realloc (block, new_size); }
static FT_MemoryRec_ m =
{
nullptr,
_hb_ft_alloc,
_hb_ft_free,
_hb_ft_realloc
};
static inline void free_static_ft_library ();
static struct hb_ft_library_lazy_loader_t : hb_lazy_loader_t<hb_remove_pointer<FT_Library>,
@ -1400,16 +1459,19 @@ static struct hb_ft_library_lazy_loader_t : hb_lazy_loader_t<hb_remove_pointer<F
static FT_Library create ()
{
FT_Library l;
if (FT_Init_FreeType (&l))
if (FT_New_Library (&m, &l))
return nullptr;
FT_Add_Default_Modules (l);
FT_Set_Default_Properties (l);
hb_atexit (free_static_ft_library);
return l;
}
static void destroy (FT_Library l)
{
FT_Done_FreeType (l);
FT_Done_Library (l);
}
static FT_Library get_null ()
{
@ -1424,9 +1486,76 @@ void free_static_ft_library ()
}
static FT_Library
get_ft_library ()
reference_ft_library ()
{
return static_ft_library.get_unconst ();
FT_Library l = static_ft_library.get_unconst ();
if (unlikely (FT_Reference_Library (l)))
{
DEBUG_MSG (FT, l, "FT_Reference_Library() failed");
return nullptr;
}
return l;
}
static hb_user_data_key_t ft_library_key = {0};
static void
finalize_ft_library (void *arg)
{
FT_Face ft_face = (FT_Face) arg;
FT_Done_Library ((FT_Library) ft_face->generic.data);
}
static void
destroy_ft_library (void *arg)
{
FT_Done_Library ((FT_Library) arg);
}
/**
* hb_ft_face_create_from_file_or_fail:
* @file_name: A font filename
* @index: The index of the face within the file
*
* Creates an #hb_face_t face object from the specified
* font file and face index.
*
* This is similar in functionality to hb_face_create_from_file_or_fail(),
* but uses the FreeType library for loading the font file.
*
* Return value: (transfer full): The new face object, or `NULL` if
* no face is found at the specified index or the file cannot be read.
*
* Since: 10.1.0
*/
hb_face_t *
hb_ft_face_create_from_file_or_fail (const char *file_name,
unsigned int index)
{
FT_Library ft_library = reference_ft_library ();
if (unlikely (!ft_library))
{
DEBUG_MSG (FT, ft_library, "reference_ft_library failed");
return nullptr;
}
FT_Face ft_face;
if (unlikely (FT_New_Face (ft_library,
file_name,
index,
&ft_face)))
return nullptr;
hb_face_t *face = hb_ft_face_create_referenced (ft_face);
FT_Done_Face (ft_face);
ft_face->generic.data = ft_library;
ft_face->generic.finalizer = finalize_ft_library;
if (hb_face_is_immutable (face))
return nullptr;
return face;
}
static void
@ -1471,26 +1600,36 @@ hb_ft_font_set_funcs (hb_font_t *font)
if (unlikely (!blob_length))
DEBUG_MSG (FT, font, "Font face has empty blob");
FT_Face ft_face = nullptr;
FT_Error err = FT_New_Memory_Face (get_ft_library (),
(const FT_Byte *) blob_data,
blob_length,
hb_face_get_index (font->face),
&ft_face);
if (unlikely (err)) {
FT_Library ft_library = reference_ft_library ();
if (unlikely (!ft_library))
{
hb_blob_destroy (blob);
DEBUG_MSG (FT, font, "Font face FT_New_Memory_Face() failed");
DEBUG_MSG (FT, font, "reference_ft_library failed");
return;
}
FT_Face ft_face = nullptr;
if (unlikely (FT_New_Memory_Face (ft_library,
(const FT_Byte *) blob_data,
blob_length,
hb_face_get_index (font->face),
&ft_face)))
{
hb_blob_destroy (blob);
DEBUG_MSG (FT, font, "FT_New_Memory_Face() failed");
return;
}
if (FT_Select_Charmap (ft_face, FT_ENCODING_MS_SYMBOL))
FT_Select_Charmap (ft_face, FT_ENCODING_UNICODE);
// Hook the blob to the FT_Face
ft_face->generic.data = blob;
ft_face->generic.finalizer = _release_blob;
// And the FT_Library to the blob
hb_blob_set_user_data (blob, &ft_library_key, ft_library, destroy_ft_library, true);
_hb_ft_font_set_funcs (font, ft_face, true);
hb_ft_font_set_load_flags (font, FT_LOAD_DEFAULT | FT_LOAD_NO_HINTING);

View file

@ -84,6 +84,9 @@ hb_ft_face_create_cached (FT_Face ft_face);
HB_EXTERN hb_face_t *
hb_ft_face_create_referenced (FT_Face ft_face);
HB_EXTERN hb_face_t *
hb_ft_face_create_from_file_or_fail (const char *file_name,
unsigned int index);
/*
* hb-font from ft-face.

View file

@ -31,6 +31,11 @@
#ifdef HAVE_ICU
#pragma GCC diagnostic push
// https://github.com/harfbuzz/harfbuzz/issues/4915
#pragma GCC diagnostic ignored "-Wredundant-decls"
#include "hb-icu.h"
#include "hb-machinery.hh"
@ -44,7 +49,6 @@
/* ICU extra semicolon, fixed since 65, https://github.com/unicode-org/icu/commit/480bec3 */
#if U_ICU_VERSION_MAJOR_NUM < 65 && (defined(__GNUC__) || defined(__clang__))
#define HB_ICU_EXTRA_SEMI_IGNORED
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wextra-semi-stmt"
#endif
@ -284,8 +288,6 @@ hb_icu_get_unicode_funcs ()
return static_icu_funcs.get_unconst ();
}
#ifdef HB_ICU_EXTRA_SEMI_IGNORED
#pragma GCC diagnostic pop
#endif
#endif

View file

@ -101,7 +101,7 @@
#endif
#ifndef HB_CFF_MAX_OPS
#define HB_CFF_MAX_OPS 10000
#define HB_CFF_MAX_OPS 200000
#endif
#ifndef HB_MAX_COMPOSITE_OPERATIONS_PER_GLYPH

View file

@ -307,7 +307,7 @@ struct hb_hashmap_t
const V& get_with_hash (const K &key, uint32_t hash) const
{
if (!items) return item_t::default_value ();
auto *item = fetch_item (key, hb_hash (key));
auto *item = fetch_item (key, hash);
if (item)
return item->value;
return item_t::default_value ();

View file

@ -30,7 +30,7 @@
#include "hb.hh"
/* Variations of this code exist in hb-coretext.cc as well
/* Variations of this code exist in hb-coretext-shape.cc as well
* as hb-aat-map.cc... */
typedef struct hb_ms_feature_t {

View file

@ -250,7 +250,7 @@ struct TTCHeader
{
switch (u.header.version.major) {
case 2: /* version 2 is compatible with version 1 */
case 1: return u.version1.get_face_count ();
case 1: hb_barrier (); return u.version1.get_face_count ();
default:return 0;
}
}
@ -258,7 +258,7 @@ struct TTCHeader
{
switch (u.header.version.major) {
case 2: /* version 2 is compatible with version 1 */
case 1: return u.version1.get_face (i);
case 1: hb_barrier (); return u.version1.get_face (i);
default:return Null (OpenTypeFontFace);
}
}
@ -270,7 +270,7 @@ struct TTCHeader
hb_barrier ();
switch (u.header.version.major) {
case 2: /* version 2 is compatible with version 1 */
case 1: return_trace (u.version1.sanitize (c));
case 1: hb_barrier (); return_trace (u.version1.sanitize (c));
default:return_trace (true);
}
}

View file

@ -209,7 +209,7 @@ struct HBUINT32VAR
}
protected:
unsigned char v[1];
unsigned char v[5];
public:
DEFINE_SIZE_MIN (1);
@ -654,7 +654,7 @@ struct UnsizedListOfOffset16To : UnsizedArray16OfOffsetTo<Type, OffsetType, Base
unsigned int i = (unsigned int) i_;
const OffsetTo<Type, OffsetType, BaseType, has_null> *p = &this->arrayZ[i];
if (unlikely ((const void *) p < (const void *) this->arrayZ)) return Null (Type); /* Overflowed. */
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return this+*p;
}
Type& operator [] (int i_)
@ -662,7 +662,7 @@ struct UnsizedListOfOffset16To : UnsizedArray16OfOffsetTo<Type, OffsetType, Base
unsigned int i = (unsigned int) i_;
const OffsetTo<Type, OffsetType, BaseType, has_null> *p = &this->arrayZ[i];
if (unlikely ((const void *) p < (const void *) this->arrayZ)) return Crap (Type); /* Overflowed. */
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return this+*p;
}
@ -713,14 +713,14 @@ struct ArrayOf
{
unsigned int i = (unsigned int) i_;
if (unlikely (i >= len)) return Null (Type);
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return arrayZ[i];
}
Type& operator [] (int i_)
{
unsigned int i = (unsigned int) i_;
if (unlikely (i >= len)) return Crap (Type);
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return arrayZ[i];
}
@ -853,14 +853,14 @@ struct List16OfOffsetTo : ArrayOf<OffsetTo<Type, OffsetType>, HBUINT16>
{
unsigned int i = (unsigned int) i_;
if (unlikely (i >= this->len)) return Null (Type);
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return this+this->arrayZ[i];
}
const Type& operator [] (int i_)
{
unsigned int i = (unsigned int) i_;
if (unlikely (i >= this->len)) return Crap (Type);
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return this+this->arrayZ[i];
}
@ -898,14 +898,14 @@ struct HeadlessArrayOf
{
unsigned int i = (unsigned int) i_;
if (unlikely (i >= lenP1 || !i)) return Null (Type);
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return arrayZ[i-1];
}
Type& operator [] (int i_)
{
unsigned int i = (unsigned int) i_;
if (unlikely (i >= lenP1 || !i)) return Crap (Type);
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return arrayZ[i-1];
}
unsigned int get_size () const
@ -992,14 +992,14 @@ struct ArrayOfM1
{
unsigned int i = (unsigned int) i_;
if (unlikely (i > lenM1)) return Null (Type);
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return arrayZ[i];
}
Type& operator [] (int i_)
{
unsigned int i = (unsigned int) i_;
if (unlikely (i > lenM1)) return Crap (Type);
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return arrayZ[i];
}
unsigned int get_size () const
@ -1184,14 +1184,14 @@ struct VarSizedBinSearchArrayOf
{
unsigned int i = (unsigned int) i_;
if (unlikely (i >= get_length ())) return Null (Type);
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return StructAtOffset<Type> (&bytesZ, i * header.unitSize);
}
Type& operator [] (int i_)
{
unsigned int i = (unsigned int) i_;
if (unlikely (i >= get_length ())) return Crap (Type);
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return StructAtOffset<Type> (&bytesZ, i * header.unitSize);
}
unsigned int get_length () const
@ -1441,7 +1441,7 @@ struct CFFIndex
hb_ubytes_t operator [] (unsigned int index) const
{
if (unlikely (index >= count)) return hb_ubytes_t ();
_hb_compiler_memory_r_barrier ();
hb_barrier ();
unsigned offset0 = offset_at (index);
unsigned offset1 = offset_at (index + 1);
if (unlikely (offset1 < offset0 || offset1 > offset_at (count)))
@ -1496,7 +1496,7 @@ struct TupleValues
};
static unsigned compile (hb_array_t<const int> values, /* IN */
hb_array_t<char> encoded_bytes /* OUT */)
hb_array_t<unsigned char> encoded_bytes /* OUT */)
{
unsigned num_values = values.length;
unsigned encoded_len = 0;
@ -1517,7 +1517,7 @@ struct TupleValues
}
static unsigned encode_value_run_as_zeroes (unsigned& i,
hb_array_t<char> encoded_bytes,
hb_array_t<unsigned char> encoded_bytes,
hb_array_t<const int> values)
{
unsigned num_values = values.length;
@ -1546,7 +1546,7 @@ struct TupleValues
}
static unsigned encode_value_run_as_bytes (unsigned &i,
hb_array_t<char> encoded_bytes,
hb_array_t<unsigned char> encoded_bytes,
hb_array_t<const int> values)
{
unsigned start = i;
@ -1600,7 +1600,7 @@ struct TupleValues
}
static unsigned encode_value_run_as_words (unsigned &i,
hb_array_t<char> encoded_bytes,
hb_array_t<unsigned char> encoded_bytes,
hb_array_t<const int> values)
{
unsigned start = i;
@ -1661,7 +1661,7 @@ struct TupleValues
}
static unsigned encode_value_run_as_longs (unsigned &i,
hb_array_t<char> encoded_bytes,
hb_array_t<unsigned char> encoded_bytes,
hb_array_t<const int> values)
{
unsigned start = i;

View file

@ -308,8 +308,8 @@ struct FDSelect
{
switch (format)
{
case 0: return format.static_size + u.format0.get_size (num_glyphs);
case 3: return format.static_size + u.format3.get_size ();
case 0: hb_barrier (); return format.static_size + u.format0.get_size (num_glyphs);
case 3: hb_barrier (); return format.static_size + u.format3.get_size ();
default:return 0;
}
}
@ -320,8 +320,8 @@ struct FDSelect
switch (format)
{
case 0: return u.format0.get_fd (glyph);
case 3: return u.format3.get_fd (glyph);
case 0: hb_barrier (); return u.format0.get_fd (glyph);
case 3: hb_barrier (); return u.format3.get_fd (glyph);
default:return 0;
}
}
@ -332,8 +332,8 @@ struct FDSelect
switch (format)
{
case 0: return u.format0.get_fd_range (glyph);
case 3: return u.format3.get_fd_range (glyph);
case 0: hb_barrier (); return u.format0.get_fd_range (glyph);
case 3: hb_barrier (); return u.format3.get_fd_range (glyph);
default:return {0, 1};
}
}
@ -347,8 +347,8 @@ struct FDSelect
switch (format)
{
case 0: return_trace (u.format0.sanitize (c, fdcount));
case 3: return_trace (u.format3.sanitize (c, fdcount));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c, fdcount));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c, fdcount));
default:return_trace (false);
}
}

View file

@ -239,8 +239,8 @@ struct Encoding
unsigned int size = min_size;
switch (table_format ())
{
case 0: size += u.format0.get_size (); break;
case 1: size += u.format1.get_size (); break;
case 0: hb_barrier (); size += u.format0.get_size (); break;
case 1: hb_barrier (); size += u.format1.get_size (); break;
}
if (has_supplement ())
size += suppEncData ().get_size ();
@ -251,8 +251,8 @@ struct Encoding
{
switch (table_format ())
{
case 0: return u.format0.get_code (glyph);
case 1: return u.format1.get_code (glyph);
case 0: hb_barrier (); return u.format0.get_code (glyph);
case 1: hb_barrier (); return u.format1.get_code (glyph);
default:return 0;
}
}
@ -276,8 +276,8 @@ struct Encoding
switch (table_format ())
{
case 0: if (unlikely (!u.format0.sanitize (c))) { return_trace (false); } break;
case 1: if (unlikely (!u.format1.sanitize (c))) { return_trace (false); } break;
case 0: hb_barrier (); if (unlikely (!u.format0.sanitize (c))) { return_trace (false); } break;
case 1: hb_barrier (); if (unlikely (!u.format1.sanitize (c))) { return_trace (false); } break;
default:return_trace (false);
}
return_trace (likely (!has_supplement () || suppEncData ().sanitize (c)));
@ -288,8 +288,8 @@ struct Encoding
{
switch (table_format ())
{
case 0: return StructAfter<CFF1SuppEncData> (u.format0.codes[u.format0.nCodes ()-1]);
case 1: return StructAfter<CFF1SuppEncData> (u.format1.ranges[u.format1.nRanges ()-1]);
case 0: hb_barrier (); return StructAfter<CFF1SuppEncData> (u.format0.codes[u.format0.nCodes ()-1]);
case 1: hb_barrier (); return StructAfter<CFF1SuppEncData> (u.format1.ranges[u.format1.nRanges ()-1]);
default:return Null (CFF1SuppEncData);
}
}
@ -567,9 +567,9 @@ struct Charset
{
switch (format)
{
case 0: return min_size + u.format0.get_size (num_glyphs);
case 1: return min_size + u.format1.get_size (num_glyphs);
case 2: return min_size + u.format2.get_size (num_glyphs);
case 0: hb_barrier (); return min_size + u.format0.get_size (num_glyphs);
case 1: hb_barrier (); return min_size + u.format1.get_size (num_glyphs);
case 2: hb_barrier (); return min_size + u.format2.get_size (num_glyphs);
default:return 0;
}
}
@ -579,9 +579,9 @@ struct Charset
{
switch (format)
{
case 0: return u.format0.get_sid (glyph, num_glyphs);
case 1: return u.format1.get_sid (glyph, num_glyphs, cache);
case 2: return u.format2.get_sid (glyph, num_glyphs, cache);
case 0: hb_barrier (); return u.format0.get_sid (glyph, num_glyphs);
case 1: hb_barrier (); return u.format1.get_sid (glyph, num_glyphs, cache);
case 2: hb_barrier (); return u.format2.get_sid (glyph, num_glyphs, cache);
default:return 0;
}
}
@ -590,9 +590,9 @@ struct Charset
{
switch (format)
{
case 0: u.format0.collect_glyph_to_sid_map (mapping, num_glyphs); return;
case 1: u.format1.collect_glyph_to_sid_map (mapping, num_glyphs); return;
case 2: u.format2.collect_glyph_to_sid_map (mapping, num_glyphs); return;
case 0: hb_barrier (); u.format0.collect_glyph_to_sid_map (mapping, num_glyphs); return;
case 1: hb_barrier (); u.format1.collect_glyph_to_sid_map (mapping, num_glyphs); return;
case 2: hb_barrier (); u.format2.collect_glyph_to_sid_map (mapping, num_glyphs); return;
default:return;
}
}
@ -601,9 +601,9 @@ struct Charset
{
switch (format)
{
case 0: return u.format0.get_glyph (sid, num_glyphs);
case 1: return u.format1.get_glyph (sid, num_glyphs);
case 2: return u.format2.get_glyph (sid, num_glyphs);
case 0: hb_barrier (); return u.format0.get_glyph (sid, num_glyphs);
case 1: hb_barrier (); return u.format1.get_glyph (sid, num_glyphs);
case 2: hb_barrier (); return u.format2.get_glyph (sid, num_glyphs);
default:return 0;
}
}
@ -617,9 +617,9 @@ struct Charset
switch (format)
{
case 0: return_trace (u.format0.sanitize (c, c->get_num_glyphs (), num_charset_entries));
case 1: return_trace (u.format1.sanitize (c, c->get_num_glyphs (), num_charset_entries));
case 2: return_trace (u.format2.sanitize (c, c->get_num_glyphs (), num_charset_entries));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c, c->get_num_glyphs (), num_charset_entries));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c, c->get_num_glyphs (), num_charset_entries));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c, c->get_num_glyphs (), num_charset_entries));
default:return_trace (false);
}
}

View file

@ -62,9 +62,9 @@ struct CFF2FDSelect
{
switch (format)
{
case 0: return format.static_size + u.format0.get_size (num_glyphs);
case 3: return format.static_size + u.format3.get_size ();
case 4: return format.static_size + u.format4.get_size ();
case 0: hb_barrier (); return format.static_size + u.format0.get_size (num_glyphs);
case 3: hb_barrier (); return format.static_size + u.format3.get_size ();
case 4: hb_barrier (); return format.static_size + u.format4.get_size ();
default:return 0;
}
}
@ -76,9 +76,9 @@ struct CFF2FDSelect
switch (format)
{
case 0: return u.format0.get_fd (glyph);
case 3: return u.format3.get_fd (glyph);
case 4: return u.format4.get_fd (glyph);
case 0: hb_barrier (); return u.format0.get_fd (glyph);
case 3: hb_barrier (); return u.format3.get_fd (glyph);
case 4: hb_barrier (); return u.format4.get_fd (glyph);
default:return 0;
}
}
@ -92,9 +92,9 @@ struct CFF2FDSelect
switch (format)
{
case 0: return_trace (u.format0.sanitize (c, fdcount));
case 3: return_trace (u.format3.sanitize (c, fdcount));
case 4: return_trace (u.format4.sanitize (c, fdcount));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c, fdcount));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c, fdcount));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c, fdcount));
default:return_trace (false);
}
}

View file

@ -43,27 +43,145 @@ namespace OT {
static inline uint8_t unicode_to_macroman (hb_codepoint_t u)
{
uint16_t mapping[] = {
0x00C4, 0x00C5, 0x00C7, 0x00C9, 0x00D1, 0x00D6, 0x00DC, 0x00E1,
0x00E0, 0x00E2, 0x00E4, 0x00E3, 0x00E5, 0x00E7, 0x00E9, 0x00E8,
0x00EA, 0x00EB, 0x00ED, 0x00EC, 0x00EE, 0x00EF, 0x00F1, 0x00F3,
0x00F2, 0x00F4, 0x00F6, 0x00F5, 0x00FA, 0x00F9, 0x00FB, 0x00FC,
0x2020, 0x00B0, 0x00A2, 0x00A3, 0x00A7, 0x2022, 0x00B6, 0x00DF,
0x00AE, 0x00A9, 0x2122, 0x00B4, 0x00A8, 0x2260, 0x00C6, 0x00D8,
0x221E, 0x00B1, 0x2264, 0x2265, 0x00A5, 0x00B5, 0x2202, 0x2211,
0x220F, 0x03C0, 0x222B, 0x00AA, 0x00BA, 0x03A9, 0x00E6, 0x00F8,
0x00BF, 0x00A1, 0x00AC, 0x221A, 0x0192, 0x2248, 0x2206, 0x00AB,
0x00BB, 0x2026, 0x00A0, 0x00C0, 0x00C3, 0x00D5, 0x0152, 0x0153,
0x2013, 0x2014, 0x201C, 0x201D, 0x2018, 0x2019, 0x00F7, 0x25CA,
0x00FF, 0x0178, 0x2044, 0x20AC, 0x2039, 0x203A, 0xFB01, 0xFB02,
0x2021, 0x00B7, 0x201A, 0x201E, 0x2030, 0x00C2, 0x00CA, 0x00C1,
0x00CB, 0x00C8, 0x00CD, 0x00CE, 0x00CF, 0x00CC, 0x00D3, 0x00D4,
0xF8FF, 0x00D2, 0x00DA, 0x00DB, 0x00D9, 0x0131, 0x02C6, 0x02DC,
0x00AF, 0x02D8, 0x02D9, 0x02DA, 0x00B8, 0x02DD, 0x02DB, 0x02C7
static const struct unicode_to_macroman_t
{
uint16_t unicode;
uint8_t macroman;
}
mapping[] =
{
{ 0x00A0, 0xCA },
{ 0x00A1, 0xC1 },
{ 0x00A2, 0xA2 },
{ 0x00A3, 0xA3 },
{ 0x00A5, 0xB4 },
{ 0x00A7, 0xA4 },
{ 0x00A8, 0xAC },
{ 0x00A9, 0xA9 },
{ 0x00AA, 0xBB },
{ 0x00AB, 0xC7 },
{ 0x00AC, 0xC2 },
{ 0x00AE, 0xA8 },
{ 0x00AF, 0xF8 },
{ 0x00B0, 0xA1 },
{ 0x00B1, 0xB1 },
{ 0x00B4, 0xAB },
{ 0x00B5, 0xB5 },
{ 0x00B6, 0xA6 },
{ 0x00B7, 0xE1 },
{ 0x00B8, 0xFC },
{ 0x00BA, 0xBC },
{ 0x00BB, 0xC8 },
{ 0x00BF, 0xC0 },
{ 0x00C0, 0xCB },
{ 0x00C1, 0xE7 },
{ 0x00C2, 0xE5 },
{ 0x00C3, 0xCC },
{ 0x00C4, 0x80 },
{ 0x00C5, 0x81 },
{ 0x00C6, 0xAE },
{ 0x00C7, 0x82 },
{ 0x00C8, 0xE9 },
{ 0x00C9, 0x83 },
{ 0x00CA, 0xE6 },
{ 0x00CB, 0xE8 },
{ 0x00CC, 0xED },
{ 0x00CD, 0xEA },
{ 0x00CE, 0xEB },
{ 0x00CF, 0xEC },
{ 0x00D1, 0x84 },
{ 0x00D2, 0xF1 },
{ 0x00D3, 0xEE },
{ 0x00D4, 0xEF },
{ 0x00D5, 0xCD },
{ 0x00D6, 0x85 },
{ 0x00D8, 0xAF },
{ 0x00D9, 0xF4 },
{ 0x00DA, 0xF2 },
{ 0x00DB, 0xF3 },
{ 0x00DC, 0x86 },
{ 0x00DF, 0xA7 },
{ 0x00E0, 0x88 },
{ 0x00E1, 0x87 },
{ 0x00E2, 0x89 },
{ 0x00E3, 0x8B },
{ 0x00E4, 0x8A },
{ 0x00E5, 0x8C },
{ 0x00E6, 0xBE },
{ 0x00E7, 0x8D },
{ 0x00E8, 0x8F },
{ 0x00E9, 0x8E },
{ 0x00EA, 0x90 },
{ 0x00EB, 0x91 },
{ 0x00EC, 0x93 },
{ 0x00ED, 0x92 },
{ 0x00EE, 0x94 },
{ 0x00EF, 0x95 },
{ 0x00F1, 0x96 },
{ 0x00F2, 0x98 },
{ 0x00F3, 0x97 },
{ 0x00F4, 0x99 },
{ 0x00F5, 0x9B },
{ 0x00F6, 0x9A },
{ 0x00F7, 0xD6 },
{ 0x00F8, 0xBF },
{ 0x00F9, 0x9D },
{ 0x00FA, 0x9C },
{ 0x00FB, 0x9E },
{ 0x00FC, 0x9F },
{ 0x00FF, 0xD8 },
{ 0x0131, 0xF5 },
{ 0x0152, 0xCE },
{ 0x0153, 0xCF },
{ 0x0178, 0xD9 },
{ 0x0192, 0xC4 },
{ 0x02C6, 0xF6 },
{ 0x02C7, 0xFF },
{ 0x02D8, 0xF9 },
{ 0x02D9, 0xFA },
{ 0x02DA, 0xFB },
{ 0x02DB, 0xFE },
{ 0x02DC, 0xF7 },
{ 0x02DD, 0xFD },
{ 0x03A9, 0xBD },
{ 0x03C0, 0xB9 },
{ 0x2013, 0xD0 },
{ 0x2014, 0xD1 },
{ 0x2018, 0xD4 },
{ 0x2019, 0xD5 },
{ 0x201A, 0xE2 },
{ 0x201C, 0xD2 },
{ 0x201D, 0xD3 },
{ 0x201E, 0xE3 },
{ 0x2020, 0xA0 },
{ 0x2021, 0xE0 },
{ 0x2022, 0xA5 },
{ 0x2026, 0xC9 },
{ 0x2030, 0xE4 },
{ 0x2039, 0xDC },
{ 0x203A, 0xDD },
{ 0x2044, 0xDA },
{ 0x20AC, 0xDB },
{ 0x2122, 0xAA },
{ 0x2202, 0xB6 },
{ 0x2206, 0xC6 },
{ 0x220F, 0xB8 },
{ 0x2211, 0xB7 },
{ 0x221A, 0xC3 },
{ 0x221E, 0xB0 },
{ 0x222B, 0xBA },
{ 0x2248, 0xC5 },
{ 0x2260, 0xAD },
{ 0x2264, 0xB2 },
{ 0x2265, 0xB3 },
{ 0x25CA, 0xD7 },
{ 0xF8FF, 0xF0 },
{ 0xFB01, 0xDE },
{ 0xFB02, 0xDF },
};
uint16_t *c = hb_bsearch (u, mapping, ARRAY_LENGTH (mapping), sizeof (mapping[0]),
_hb_cmp_operator<uint16_t, uint16_t>);
return c ? (c - mapping) + 0x7F : 0;
auto *c = hb_bsearch (u, mapping, ARRAY_LENGTH (mapping), sizeof (mapping[0]),
_hb_cmp_operator<uint16_t, uint16_t>);
return c ? c->macroman : 0;
}
struct CmapSubtableFormat0
@ -1379,12 +1497,12 @@ struct CmapSubtable
hb_codepoint_t *glyph) const
{
switch (u.format) {
case 0: return u.format0 .get_glyph (codepoint, glyph);
case 4: return u.format4 .get_glyph (codepoint, glyph);
case 6: return u.format6 .get_glyph (codepoint, glyph);
case 10: return u.format10.get_glyph (codepoint, glyph);
case 12: return u.format12.get_glyph (codepoint, glyph);
case 13: return u.format13.get_glyph (codepoint, glyph);
case 0: hb_barrier (); return u.format0 .get_glyph (codepoint, glyph);
case 4: hb_barrier (); return u.format4 .get_glyph (codepoint, glyph);
case 6: hb_barrier (); return u.format6 .get_glyph (codepoint, glyph);
case 10: hb_barrier (); return u.format10.get_glyph (codepoint, glyph);
case 12: hb_barrier (); return u.format12.get_glyph (codepoint, glyph);
case 13: hb_barrier (); return u.format13.get_glyph (codepoint, glyph);
case 14:
default: return false;
}
@ -1392,12 +1510,12 @@ struct CmapSubtable
void collect_unicodes (hb_set_t *out, unsigned int num_glyphs = UINT_MAX) const
{
switch (u.format) {
case 0: u.format0 .collect_unicodes (out); return;
case 4: u.format4 .collect_unicodes (out); return;
case 6: u.format6 .collect_unicodes (out); return;
case 10: u.format10.collect_unicodes (out); return;
case 12: u.format12.collect_unicodes (out, num_glyphs); return;
case 13: u.format13.collect_unicodes (out, num_glyphs); return;
case 0: hb_barrier (); u.format0 .collect_unicodes (out); return;
case 4: hb_barrier (); u.format4 .collect_unicodes (out); return;
case 6: hb_barrier (); u.format6 .collect_unicodes (out); return;
case 10: hb_barrier (); u.format10.collect_unicodes (out); return;
case 12: hb_barrier (); u.format12.collect_unicodes (out, num_glyphs); return;
case 13: hb_barrier (); u.format13.collect_unicodes (out, num_glyphs); return;
case 14:
default: return;
}
@ -1408,12 +1526,12 @@ struct CmapSubtable
unsigned num_glyphs = UINT_MAX) const
{
switch (u.format) {
case 0: u.format0 .collect_mapping (unicodes, mapping); return;
case 4: u.format4 .collect_mapping (unicodes, mapping); return;
case 6: u.format6 .collect_mapping (unicodes, mapping); return;
case 10: u.format10.collect_mapping (unicodes, mapping); return;
case 12: u.format12.collect_mapping (unicodes, mapping, num_glyphs); return;
case 13: u.format13.collect_mapping (unicodes, mapping, num_glyphs); return;
case 0: hb_barrier (); u.format0 .collect_mapping (unicodes, mapping); return;
case 4: hb_barrier (); u.format4 .collect_mapping (unicodes, mapping); return;
case 6: hb_barrier (); u.format6 .collect_mapping (unicodes, mapping); return;
case 10: hb_barrier (); u.format10.collect_mapping (unicodes, mapping); return;
case 12: hb_barrier (); u.format12.collect_mapping (unicodes, mapping, num_glyphs); return;
case 13: hb_barrier (); u.format13.collect_mapping (unicodes, mapping, num_glyphs); return;
case 14:
default: return;
}
@ -1422,12 +1540,12 @@ struct CmapSubtable
unsigned get_language () const
{
switch (u.format) {
case 0: return u.format0 .get_language ();
case 4: return u.format4 .get_language ();
case 6: return u.format6 .get_language ();
case 10: return u.format10.get_language ();
case 12: return u.format12.get_language ();
case 13: return u.format13.get_language ();
case 0: hb_barrier (); return u.format0 .get_language ();
case 4: hb_barrier (); return u.format4 .get_language ();
case 6: hb_barrier (); return u.format6 .get_language ();
case 10: hb_barrier (); return u.format10.get_language ();
case 12: hb_barrier (); return u.format12.get_language ();
case 13: hb_barrier (); return u.format13.get_language ();
case 14:
default: return 0;
}
@ -1442,9 +1560,9 @@ struct CmapSubtable
const void *base)
{
switch (format) {
case 4: return u.format4.serialize (c, it);
case 12: return u.format12.serialize (c, it);
case 14: return u.format14.serialize (c, &plan->unicodes, &plan->glyphs_requested, plan->glyph_map, base);
case 4: hb_barrier (); return u.format4.serialize (c, it);
case 12: hb_barrier (); return u.format12.serialize (c, it);
case 14: hb_barrier (); return u.format14.serialize (c, &plan->unicodes, &plan->glyphs_requested, plan->glyph_map, base);
default: return;
}
}
@ -1455,13 +1573,13 @@ struct CmapSubtable
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 0: return_trace (u.format0 .sanitize (c));
case 4: return_trace (u.format4 .sanitize (c));
case 6: return_trace (u.format6 .sanitize (c));
case 10: return_trace (u.format10.sanitize (c));
case 12: return_trace (u.format12.sanitize (c));
case 13: return_trace (u.format13.sanitize (c));
case 14: return_trace (u.format14.sanitize (c));
case 0: hb_barrier (); return_trace (u.format0 .sanitize (c));
case 4: hb_barrier (); return_trace (u.format4 .sanitize (c));
case 6: hb_barrier (); return_trace (u.format6 .sanitize (c));
case 10: hb_barrier (); return_trace (u.format10.sanitize (c));
case 12: hb_barrier (); return_trace (u.format12.sanitize (c));
case 13: hb_barrier (); return_trace (u.format13.sanitize (c));
case 14: hb_barrier (); return_trace (u.format14.sanitize (c));
default:return_trace (true);
}
}

View file

@ -642,7 +642,9 @@ _hb_ot_get_font_funcs ()
* hb_ot_font_set_funcs:
* @font: #hb_font_t to work upon
*
* Sets the font functions to use when working with @font.
* Sets the font functions to use when working with @font to
* the HarfBuzz's native implementation. This is the default
* for fonts newly created.
*
* Since: 0.9.28
**/

View file

@ -132,7 +132,7 @@ struct KernSubTable
{
switch (get_type ()) {
/* This method hooks up to hb_font_t's get_h_kerning. Only support Format0. */
case 0: return u.format0.get_kerning (left, right);
case 0: hb_barrier (); return u.format0.get_kerning (left, right);
default:return 0;
}
}
@ -311,9 +311,9 @@ struct kern
bool has_state_machine () const
{
switch (get_type ()) {
case 0: return u.ot.has_state_machine ();
case 0: hb_barrier (); return u.ot.has_state_machine ();
#ifndef HB_NO_AAT_SHAPE
case 1: return u.aat.has_state_machine ();
case 1: hb_barrier (); return u.aat.has_state_machine ();
#endif
default:return false;
}
@ -322,9 +322,9 @@ struct kern
bool has_cross_stream () const
{
switch (get_type ()) {
case 0: return u.ot.has_cross_stream ();
case 0: hb_barrier (); return u.ot.has_cross_stream ();
#ifndef HB_NO_AAT_SHAPE
case 1: return u.aat.has_cross_stream ();
case 1: hb_barrier (); return u.aat.has_cross_stream ();
#endif
default:return false;
}
@ -333,9 +333,9 @@ struct kern
int get_h_kerning (hb_codepoint_t left, hb_codepoint_t right) const
{
switch (get_type ()) {
case 0: return u.ot.get_h_kerning (left, right);
case 0: hb_barrier (); return u.ot.get_h_kerning (left, right);
#ifndef HB_NO_AAT_SHAPE
case 1: return u.aat.get_h_kerning (left, right);
case 1: hb_barrier (); return u.aat.get_h_kerning (left, right);
#endif
default:return 0;
}
@ -370,9 +370,9 @@ struct kern
AAT::kern_accelerator_data_t create_accelerator_data (unsigned num_glyphs) const
{
switch (get_type ()) {
case 0: return u.ot.create_accelerator_data (num_glyphs);
case 0: hb_barrier (); return u.ot.create_accelerator_data (num_glyphs);
#ifndef HB_NO_AAT_SHAPE
case 1: return u.aat.create_accelerator_data (num_glyphs);
case 1: hb_barrier (); return u.aat.create_accelerator_data (num_glyphs);
#endif
default:return AAT::kern_accelerator_data_t ();
}

View file

@ -172,9 +172,9 @@ struct BaseCoord
hb_direction_t direction) const
{
switch (u.format) {
case 1: return u.format1.get_coord (font, direction);
case 2: return u.format2.get_coord (font, direction);
case 3: return u.format3.get_coord (font, var_store, direction);
case 1: hb_barrier (); return u.format1.get_coord (font, direction);
case 2: hb_barrier (); return u.format2.get_coord (font, direction);
case 3: hb_barrier (); return u.format3.get_coord (font, var_store, direction);
default:return 0;
}
}
@ -182,7 +182,7 @@ struct BaseCoord
void collect_variation_indices (hb_set_t& varidx_set /* OUT */) const
{
switch (u.format) {
case 3: u.format3.collect_variation_indices (varidx_set);
case 3: hb_barrier (); u.format3.collect_variation_indices (varidx_set);
default:return;
}
}
@ -193,9 +193,9 @@ struct BaseCoord
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
default:return_trace (c->default_return_value ());
}
}
@ -206,9 +206,9 @@ struct BaseCoord
if (unlikely (!u.format.sanitize (c))) return_trace (false);
hb_barrier ();
switch (u.format) {
case 1: return_trace (u.format1.sanitize (c));
case 2: return_trace (u.format2.sanitize (c));
case 3: return_trace (u.format3.sanitize (c));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c));
default:return_trace (false);
}
}

View file

@ -646,8 +646,7 @@ struct FeatureParamsCharacterVariants
return;
unsigned last_name_id = (unsigned) firstParamUILabelNameID + (unsigned) numNamedParameters - 1;
if (last_name_id >= 256 && last_name_id <= 32767)
nameids_to_retain->add_range (firstParamUILabelNameID, last_name_id);
nameids_to_retain->add_range (firstParamUILabelNameID, last_name_id);
}
bool subset (hb_subset_context_t *c) const
@ -2068,11 +2067,11 @@ struct ClassDef
unsigned int get_class (hb_codepoint_t glyph_id) const
{
switch (u.format) {
case 1: return u.format1.get_class (glyph_id);
case 2: return u.format2.get_class (glyph_id);
case 1: hb_barrier (); return u.format1.get_class (glyph_id);
case 2: hb_barrier (); return u.format2.get_class (glyph_id);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.get_class (glyph_id);
case 4: return u.format4.get_class (glyph_id);
case 3: hb_barrier (); return u.format3.get_class (glyph_id);
case 4: hb_barrier (); return u.format4.get_class (glyph_id);
#endif
default:return 0;
}
@ -2081,11 +2080,11 @@ struct ClassDef
unsigned get_population () const
{
switch (u.format) {
case 1: return u.format1.get_population ();
case 2: return u.format2.get_population ();
case 1: hb_barrier (); return u.format1.get_population ();
case 2: hb_barrier (); return u.format2.get_population ();
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.get_population ();
case 4: return u.format4.get_population ();
case 3: hb_barrier (); return u.format3.get_population ();
case 4: hb_barrier (); return u.format4.get_population ();
#endif
default:return NOT_COVERED;
}
@ -2147,11 +2146,11 @@ struct ClassDef
switch (u.format)
{
case 1: return_trace (u.format1.serialize (c, it));
case 2: return_trace (u.format2.serialize (c, it));
case 1: hb_barrier (); return_trace (u.format1.serialize (c, it));
case 2: hb_barrier (); return_trace (u.format2.serialize (c, it));
#ifndef HB_NO_BEYOND_64K
case 3: return_trace (u.format3.serialize (c, it));
case 4: return_trace (u.format4.serialize (c, it));
case 3: hb_barrier (); return_trace (u.format3.serialize (c, it));
case 4: hb_barrier (); return_trace (u.format4.serialize (c, it));
#endif
default:return_trace (false);
}
@ -2165,11 +2164,11 @@ struct ClassDef
{
TRACE_SUBSET (this);
switch (u.format) {
case 1: return_trace (u.format1.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 2: return_trace (u.format2.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 1: hb_barrier (); return_trace (u.format1.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 2: hb_barrier (); return_trace (u.format2.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
#ifndef HB_NO_BEYOND_64K
case 3: return_trace (u.format3.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 4: return_trace (u.format4.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 3: hb_barrier (); return_trace (u.format3.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
case 4: hb_barrier (); return_trace (u.format4.subset (c, klass_map, keep_empty_table, use_class_zero, glyph_filter));
#endif
default:return_trace (false);
}
@ -2181,11 +2180,11 @@ struct ClassDef
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 1: return_trace (u.format1.sanitize (c));
case 2: return_trace (u.format2.sanitize (c));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c));
#ifndef HB_NO_BEYOND_64K
case 3: return_trace (u.format3.sanitize (c));
case 4: return_trace (u.format4.sanitize (c));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c));
#endif
default:return_trace (true);
}
@ -2194,11 +2193,11 @@ struct ClassDef
unsigned cost () const
{
switch (u.format) {
case 1: return u.format1.cost ();
case 2: return u.format2.cost ();
case 1: hb_barrier (); return u.format1.cost ();
case 2: hb_barrier (); return u.format2.cost ();
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.cost ();
case 4: return u.format4.cost ();
case 3: hb_barrier (); return u.format3.cost ();
case 4: hb_barrier (); return u.format4.cost ();
#endif
default:return 0u;
}
@ -2210,11 +2209,11 @@ struct ClassDef
bool collect_coverage (set_t *glyphs) const
{
switch (u.format) {
case 1: return u.format1.collect_coverage (glyphs);
case 2: return u.format2.collect_coverage (glyphs);
case 1: hb_barrier (); return u.format1.collect_coverage (glyphs);
case 2: hb_barrier (); return u.format2.collect_coverage (glyphs);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.collect_coverage (glyphs);
case 4: return u.format4.collect_coverage (glyphs);
case 3: hb_barrier (); return u.format3.collect_coverage (glyphs);
case 4: hb_barrier (); return u.format4.collect_coverage (glyphs);
#endif
default:return false;
}
@ -2226,11 +2225,11 @@ struct ClassDef
bool collect_class (set_t *glyphs, unsigned int klass) const
{
switch (u.format) {
case 1: return u.format1.collect_class (glyphs, klass);
case 2: return u.format2.collect_class (glyphs, klass);
case 1: hb_barrier (); return u.format1.collect_class (glyphs, klass);
case 2: hb_barrier (); return u.format2.collect_class (glyphs, klass);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.collect_class (glyphs, klass);
case 4: return u.format4.collect_class (glyphs, klass);
case 3: hb_barrier (); return u.format3.collect_class (glyphs, klass);
case 4: hb_barrier (); return u.format4.collect_class (glyphs, klass);
#endif
default:return false;
}
@ -2239,11 +2238,11 @@ struct ClassDef
bool intersects (const hb_set_t *glyphs) const
{
switch (u.format) {
case 1: return u.format1.intersects (glyphs);
case 2: return u.format2.intersects (glyphs);
case 1: hb_barrier (); return u.format1.intersects (glyphs);
case 2: hb_barrier (); return u.format2.intersects (glyphs);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.intersects (glyphs);
case 4: return u.format4.intersects (glyphs);
case 3: hb_barrier (); return u.format3.intersects (glyphs);
case 4: hb_barrier (); return u.format4.intersects (glyphs);
#endif
default:return false;
}
@ -2251,11 +2250,11 @@ struct ClassDef
bool intersects_class (const hb_set_t *glyphs, unsigned int klass) const
{
switch (u.format) {
case 1: return u.format1.intersects_class (glyphs, klass);
case 2: return u.format2.intersects_class (glyphs, klass);
case 1: hb_barrier (); return u.format1.intersects_class (glyphs, klass);
case 2: hb_barrier (); return u.format2.intersects_class (glyphs, klass);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.intersects_class (glyphs, klass);
case 4: return u.format4.intersects_class (glyphs, klass);
case 3: hb_barrier (); return u.format3.intersects_class (glyphs, klass);
case 4: hb_barrier (); return u.format4.intersects_class (glyphs, klass);
#endif
default:return false;
}
@ -2264,11 +2263,11 @@ struct ClassDef
void intersected_class_glyphs (const hb_set_t *glyphs, unsigned klass, hb_set_t *intersect_glyphs) const
{
switch (u.format) {
case 1: return u.format1.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 2: return u.format2.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 1: hb_barrier (); return u.format1.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 2: hb_barrier (); return u.format2.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 4: return u.format4.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 3: hb_barrier (); return u.format3.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
case 4: hb_barrier (); return u.format4.intersected_class_glyphs (glyphs, klass, intersect_glyphs);
#endif
default:return;
}
@ -2277,11 +2276,11 @@ struct ClassDef
void intersected_classes (const hb_set_t *glyphs, hb_set_t *intersect_classes) const
{
switch (u.format) {
case 1: return u.format1.intersected_classes (glyphs, intersect_classes);
case 2: return u.format2.intersected_classes (glyphs, intersect_classes);
case 1: hb_barrier (); return u.format1.intersected_classes (glyphs, intersect_classes);
case 2: hb_barrier (); return u.format2.intersected_classes (glyphs, intersect_classes);
#ifndef HB_NO_BEYOND_64K
case 3: return u.format3.intersected_classes (glyphs, intersect_classes);
case 4: return u.format4.intersected_classes (glyphs, intersect_classes);
case 3: hb_barrier (); return u.format3.intersected_classes (glyphs, intersect_classes);
case 4: hb_barrier (); return u.format4.intersected_classes (glyphs, intersect_classes);
#endif
default:return;
}
@ -3638,8 +3637,8 @@ struct DeltaSetIndexMap
unsigned length = plan.get_output_map ().length;
u.format = length <= 0xFFFF ? 0 : 1;
switch (u.format) {
case 0: return_trace (u.format0.serialize (c, plan));
case 1: return_trace (u.format1.serialize (c, plan));
case 0: hb_barrier (); return_trace (u.format0.serialize (c, plan));
case 1: hb_barrier (); return_trace (u.format1.serialize (c, plan));
default:return_trace (false);
}
}
@ -3647,8 +3646,8 @@ struct DeltaSetIndexMap
uint32_t map (unsigned v) const
{
switch (u.format) {
case 0: return (u.format0.map (v));
case 1: return (u.format1.map (v));
case 0: hb_barrier (); return (u.format0.map (v));
case 1: hb_barrier (); return (u.format1.map (v));
default:return v;
}
}
@ -3656,8 +3655,8 @@ struct DeltaSetIndexMap
unsigned get_map_count () const
{
switch (u.format) {
case 0: return u.format0.get_map_count ();
case 1: return u.format1.get_map_count ();
case 0: hb_barrier (); return u.format0.get_map_count ();
case 1: hb_barrier (); return u.format1.get_map_count ();
default:return 0;
}
}
@ -3665,8 +3664,8 @@ struct DeltaSetIndexMap
unsigned get_width () const
{
switch (u.format) {
case 0: return u.format0.get_width ();
case 1: return u.format1.get_width ();
case 0: hb_barrier (); return u.format0.get_width ();
case 1: hb_barrier (); return u.format1.get_width ();
default:return 0;
}
}
@ -3674,8 +3673,8 @@ struct DeltaSetIndexMap
unsigned get_inner_bit_count () const
{
switch (u.format) {
case 0: return u.format0.get_inner_bit_count ();
case 1: return u.format1.get_inner_bit_count ();
case 0: hb_barrier (); return u.format0.get_inner_bit_count ();
case 1: hb_barrier (); return u.format1.get_inner_bit_count ();
default:return 0;
}
}
@ -3686,8 +3685,8 @@ struct DeltaSetIndexMap
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 0: return_trace (u.format0.sanitize (c));
case 1: return_trace (u.format1.sanitize (c));
case 0: hb_barrier (); return_trace (u.format0.sanitize (c));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c));
default:return_trace (true);
}
}
@ -3696,8 +3695,8 @@ struct DeltaSetIndexMap
{
TRACE_SERIALIZE (this);
switch (u.format) {
case 0: return_trace (reinterpret_cast<DeltaSetIndexMap *> (u.format0.copy (c)));
case 1: return_trace (reinterpret_cast<DeltaSetIndexMap *> (u.format1.copy (c)));
case 0: hb_barrier (); return_trace (reinterpret_cast<DeltaSetIndexMap *> (u.format0.copy (c)));
case 1: hb_barrier (); return_trace (reinterpret_cast<DeltaSetIndexMap *> (u.format1.copy (c)));
default:return_trace (nullptr);
}
}
@ -3715,11 +3714,11 @@ struct DeltaSetIndexMap
struct ItemVarStoreInstancer
{
ItemVarStoreInstancer (const ItemVariationStore *varStore,
ItemVarStoreInstancer (const ItemVariationStore *varStore_,
const DeltaSetIndexMap *varIdxMap,
hb_array_t<const int> coords,
VarRegionList::cache_t *cache = nullptr) :
varStore (varStore), varIdxMap (varIdxMap), coords (coords), cache (cache)
varStore (varStore_), varIdxMap (varIdxMap), coords (coords), cache (cache)
{
if (!varStore)
varStore = &Null(ItemVariationStore);
@ -3799,6 +3798,7 @@ enum Cond_with_Var_flag_t
DROP_RECORD_WITH_VAR = 3,
};
struct Condition;
template <typename Instancer>
static bool
@ -4111,11 +4111,11 @@ struct Condition
Instancer *instancer) const
{
switch (u.format) {
case 1: return u.format1.evaluate (coords, coord_len, instancer);
case 2: return u.format2.evaluate (coords, coord_len, instancer);
case 3: return u.format3.evaluate (coords, coord_len, instancer);
case 4: return u.format4.evaluate (coords, coord_len, instancer);
case 5: return u.format5.evaluate (coords, coord_len, instancer);
case 1: hb_barrier (); return u.format1.evaluate (coords, coord_len, instancer);
case 2: hb_barrier (); return u.format2.evaluate (coords, coord_len, instancer);
case 3: hb_barrier (); return u.format3.evaluate (coords, coord_len, instancer);
case 4: hb_barrier (); return u.format4.evaluate (coords, coord_len, instancer);
case 5: hb_barrier (); return u.format5.evaluate (coords, coord_len, instancer);
default:return false;
}
}
@ -4124,7 +4124,7 @@ struct Condition
hb_map_t *condition_map /* OUT */) const
{
switch (u.format) {
case 1: return u.format1.keep_with_variations (c, condition_map);
case 1: hb_barrier (); return u.format1.keep_with_variations (c, condition_map);
// TODO(subset)
default: c->apply = false; return KEEP_COND_WITH_VAR;
}
@ -4136,11 +4136,11 @@ struct Condition
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 4: return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
default:return_trace (c->default_return_value ());
}
}
@ -4151,11 +4151,11 @@ struct Condition
if (!u.format.sanitize (c)) return_trace (false);
hb_barrier ();
switch (u.format) {
case 1: return_trace (u.format1.sanitize (c));
case 2: return_trace (u.format2.sanitize (c));
case 3: return_trace (u.format3.sanitize (c));
case 4: return_trace (u.format4.sanitize (c));
case 5: return_trace (u.format5.sanitize (c));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c));
case 5: hb_barrier (); return_trace (u.format5.sanitize (c));
default:return_trace (true);
}
}

View file

@ -406,6 +406,7 @@ struct hb_ot_apply_context_t :
void set_ignore_zwnj (bool ignore_zwnj_) { ignore_zwnj = ignore_zwnj_; }
void set_ignore_zwj (bool ignore_zwj_) { ignore_zwj = ignore_zwj_; }
void set_ignore_hidden (bool ignore_hidden_) { ignore_hidden = ignore_hidden_; }
void set_lookup_props (unsigned int lookup_props_) { lookup_props = lookup_props_; }
void set_mask (hb_mask_t mask_) { mask = mask_; }
void set_per_syllable (bool per_syllable_) { per_syllable = per_syllable_; }
@ -451,9 +452,10 @@ struct hb_ot_apply_context_t :
if (!c->check_glyph_property (&info, lookup_props))
return SKIP_YES;
if (unlikely (_hb_glyph_info_is_default_ignorable_and_not_hidden (&info) &&
if (unlikely (_hb_glyph_info_is_default_ignorable (&info) &&
(ignore_zwnj || !_hb_glyph_info_is_zwnj (&info)) &&
(ignore_zwj || !_hb_glyph_info_is_zwj (&info))))
(ignore_zwj || !_hb_glyph_info_is_zwj (&info)) &&
(ignore_hidden || !_hb_glyph_info_is_hidden (&info))))
return SKIP_MAYBE;
return SKIP_NO;
@ -464,6 +466,7 @@ struct hb_ot_apply_context_t :
hb_mask_t mask = -1;
bool ignore_zwnj = false;
bool ignore_zwj = false;
bool ignore_hidden = false;
bool per_syllable = false;
uint8_t syllable = 0;
match_func_t match_func = nullptr;
@ -486,6 +489,8 @@ struct hb_ot_apply_context_t :
matcher.set_ignore_zwnj (c->table_index == 1 || (context_match && c->auto_zwnj));
/* Ignore ZWJ if we are matching context, or asked to. */
matcher.set_ignore_zwj (context_match || c->auto_zwj);
/* Ignore hidden glyphs (like CGJ) during GPOS. */
matcher.set_ignore_hidden (c->table_index == 1);
matcher.set_mask (context_match ? -1 : c->lookup_mask);
/* Per syllable matching is only for GSUB. */
matcher.set_per_syllable (c->table_index == 0 && c->per_syllable);
@ -2901,12 +2906,12 @@ struct Context
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
#ifndef HB_NO_BEYOND_64K
case 4: return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
#endif
default:return_trace (c->default_return_value ());
}
@ -3390,6 +3395,15 @@ struct ChainRuleSet
*
* Replicated from LigatureSet::apply(). */
/* If the input skippy has non-auto joiners behavior (as in Indic shapers),
* skip this fast path, as we don't distinguish between input & lookahead
* matching in the fast path.
*
* https://github.com/harfbuzz/harfbuzz/issues/4813
*/
if (!c->auto_zwnj || !c->auto_zwj)
goto slow;
hb_ot_apply_context_t::skipping_iterator_t &skippy_iter = c->iter_input;
skippy_iter.reset (c->buffer->idx);
skippy_iter.set_match_func (match_always, nullptr);
@ -3429,10 +3443,10 @@ struct ChainRuleSet
}
matched = skippy_iter.next ();
if (likely (matched && !skippy_iter.may_skip (c->buffer->info[skippy_iter.idx])))
{
{
second = &c->buffer->info[skippy_iter.idx];
unsafe_to2 = skippy_iter.idx + 1;
}
}
auto match_input = lookup_context.funcs.match[1];
auto match_lookahead = lookup_context.funcs.match[2];
@ -4225,12 +4239,12 @@ struct ChainContext
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
#ifndef HB_NO_BEYOND_64K
case 4: return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 5: hb_barrier (); return_trace (c->dispatch (u.format5, std::forward<Ts> (ds)...));
#endif
default:return_trace (c->default_return_value ());
}
@ -4314,7 +4328,7 @@ struct Extension
unsigned int get_type () const
{
switch (u.format) {
case 1: return u.format1.get_type ();
case 1: hb_barrier (); return u.format1.get_type ();
default:return 0;
}
}
@ -4322,7 +4336,7 @@ struct Extension
const X& get_subtable () const
{
switch (u.format) {
case 1: return u.format1.template get_subtable<typename T::SubTable> ();
case 1: hb_barrier (); return u.format1.template get_subtable<typename T::SubTable> ();
default:return Null (typename T::SubTable);
}
}
@ -4334,7 +4348,7 @@ struct Extension
typename hb_subset_context_t::return_t dispatch (hb_subset_context_t *c, Ts&&... ds) const
{
switch (u.format) {
case 1: return u.format1.subset (c);
case 1: hb_barrier (); return u.format1.subset (c);
default: return c->default_return_value ();
}
}
@ -4345,7 +4359,7 @@ struct Extension
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (u.format1.dispatch (c, std::forward<Ts> (ds)...));
default:return_trace (c->default_return_value ());
}
}
@ -4560,9 +4574,9 @@ struct GSUBGPOS
unsigned int get_size () const
{
switch (u.version.major) {
case 1: return u.version1.get_size ();
case 1: hb_barrier (); return u.version1.get_size ();
#ifndef HB_NO_BEYOND_64K
case 2: return u.version2.get_size ();
case 2: hb_barrier (); return u.version2.get_size ();
#endif
default: return u.version.static_size;
}
@ -4575,9 +4589,9 @@ struct GSUBGPOS
if (unlikely (!u.version.sanitize (c))) return_trace (false);
hb_barrier ();
switch (u.version.major) {
case 1: return_trace (u.version1.sanitize<TLookup> (c));
case 1: hb_barrier (); return_trace (u.version1.sanitize<TLookup> (c));
#ifndef HB_NO_BEYOND_64K
case 2: return_trace (u.version2.sanitize<TLookup> (c));
case 2: hb_barrier (); return_trace (u.version2.sanitize<TLookup> (c));
#endif
default: return_trace (true);
}
@ -4587,9 +4601,9 @@ struct GSUBGPOS
bool subset (hb_subset_layout_context_t *c) const
{
switch (u.version.major) {
case 1: return u.version1.subset<TLookup> (c);
case 1: hb_barrier (); return u.version1.subset<TLookup> (c);
#ifndef HB_NO_BEYOND_64K
case 2: return u.version2.subset<TLookup> (c);
case 2: hb_barrier (); return u.version2.subset<TLookup> (c);
#endif
default: return false;
}
@ -4598,9 +4612,9 @@ struct GSUBGPOS
const ScriptList &get_script_list () const
{
switch (u.version.major) {
case 1: return this+u.version1.scriptList;
case 1: hb_barrier (); return this+u.version1.scriptList;
#ifndef HB_NO_BEYOND_64K
case 2: return this+u.version2.scriptList;
case 2: hb_barrier (); return this+u.version2.scriptList;
#endif
default: return Null (ScriptList);
}
@ -4608,9 +4622,9 @@ struct GSUBGPOS
const FeatureList &get_feature_list () const
{
switch (u.version.major) {
case 1: return this+u.version1.featureList;
case 1: hb_barrier (); return this+u.version1.featureList;
#ifndef HB_NO_BEYOND_64K
case 2: return this+u.version2.featureList;
case 2: hb_barrier (); return this+u.version2.featureList;
#endif
default: return Null (FeatureList);
}
@ -4618,9 +4632,9 @@ struct GSUBGPOS
unsigned int get_lookup_count () const
{
switch (u.version.major) {
case 1: return (this+u.version1.lookupList).len;
case 1: hb_barrier (); return (this+u.version1.lookupList).len;
#ifndef HB_NO_BEYOND_64K
case 2: return (this+u.version2.lookupList).len;
case 2: hb_barrier (); return (this+u.version2.lookupList).len;
#endif
default: return 0;
}
@ -4628,9 +4642,9 @@ struct GSUBGPOS
const Lookup& get_lookup (unsigned int i) const
{
switch (u.version.major) {
case 1: return (this+u.version1.lookupList)[i];
case 1: hb_barrier (); return (this+u.version1.lookupList)[i];
#ifndef HB_NO_BEYOND_64K
case 2: return (this+u.version2.lookupList)[i];
case 2: hb_barrier (); return (this+u.version2.lookupList)[i];
#endif
default: return Null (Lookup);
}
@ -4638,9 +4652,9 @@ struct GSUBGPOS
const FeatureVariations &get_feature_variations () const
{
switch (u.version.major) {
case 1: return (u.version.to_int () >= 0x00010001u ? this+u.version1.featureVars : Null (FeatureVariations));
case 1: hb_barrier (); return (u.version.to_int () >= 0x00010001u && hb_barrier () ? this+u.version1.featureVars : Null (FeatureVariations));
#ifndef HB_NO_BEYOND_64K
case 2: return this+u.version2.featureVars;
case 2: hb_barrier (); return this+u.version2.featureVars;
#endif
default: return Null (FeatureVariations);
}

View file

@ -173,12 +173,12 @@ _hb_next_syllable (hb_buffer_t *buffer, unsigned int start)
/* Design:
* unicode_props() is a two-byte number. The low byte includes:
* - General_Category: 5 bits.
* - Modified General_Category: 5 bits.
* - A bit each for:
* * Is it Default_Ignorable(); we have a modified Default_Ignorable().
* * Whether it's one of the four Mongolian Free Variation Selectors,
* CGJ, or other characters that are hidden but should not be ignored
* like most other Default_Ignorable()s do during matching.
* like most other Default_Ignorable()s do during GSUB matching.
* * Whether it's a grapheme continuation.
*
* The high-byte has different meanings, switched by the Gen-Cat:
@ -186,17 +186,23 @@ _hb_next_syllable (hb_buffer_t *buffer, unsigned int start)
* - For Cf: whether it's ZWJ, ZWNJ, or something else.
* - For Ws: index of which space character this is, if space fallback
* is needed, ie. we don't set this by default, only if asked to.
*
* Above I said "modified" General_Category. This is because we need to
* remember Variation Selectors, and we don't have bits left. So we
* change their Gen_Cat from Mn to Cf, and use a bit of the high byte to
* remember them.
*/
enum hb_unicode_props_flags_t {
UPROPS_MASK_GEN_CAT = 0x001Fu,
UPROPS_MASK_IGNORABLE = 0x0020u,
UPROPS_MASK_HIDDEN = 0x0040u, /* MONGOLIAN FREE VARIATION SELECTOR 1..4, or TAG characters */
UPROPS_MASK_HIDDEN = 0x0040u, /* MONGOLIAN FREE VARIATION SELECTOR 1..4, or TAG characters, or CGJ sometimes */
UPROPS_MASK_CONTINUATION=0x0080u,
/* If GEN_CAT=FORMAT, top byte masks: */
UPROPS_MASK_Cf_ZWJ = 0x0100u,
UPROPS_MASK_Cf_ZWNJ = 0x0200u
UPROPS_MASK_Cf_ZWNJ = 0x0200u,
UPROPS_MASK_Cf_VS = 0x0400u
};
HB_MARK_AS_FLAG_T (hb_unicode_props_flags_t);
@ -229,7 +235,7 @@ _hb_glyph_info_set_unicode_props (hb_glyph_info_t *info, hb_buffer_t *buffer)
/* TAG characters need similar treatment. Fixes:
* https://github.com/harfbuzz/harfbuzz/issues/463 */
else if (unlikely (hb_in_range<hb_codepoint_t> (u, 0xE0020u, 0xE007Fu))) props |= UPROPS_MASK_HIDDEN;
/* COMBINING GRAPHEME JOINER should not be skipped; at least some times.
/* COMBINING GRAPHEME JOINER should not be skipped during GSUB either.
* https://github.com/harfbuzz/harfbuzz/issues/554 */
else if (unlikely (u == 0x034Fu))
{
@ -302,6 +308,27 @@ _hb_glyph_info_get_unicode_space_fallback_type (const hb_glyph_info_t *info)
(hb_unicode_funcs_t::space_t) (info->unicode_props()>>8) :
hb_unicode_funcs_t::NOT_SPACE;
}
static inline bool
_hb_glyph_info_is_variation_selector (const hb_glyph_info_t *info)
{
return _hb_glyph_info_get_general_category (info) ==
HB_UNICODE_GENERAL_CATEGORY_FORMAT &&
(info->unicode_props() & UPROPS_MASK_Cf_VS);
}
static inline void
_hb_glyph_info_set_variation_selector (hb_glyph_info_t *info, bool customize)
{
if (customize)
{
_hb_glyph_info_set_general_category (info, HB_UNICODE_GENERAL_CATEGORY_FORMAT);
info->unicode_props() |= UPROPS_MASK_Cf_VS;
}
else
{
// Reset to their original condition
_hb_glyph_info_set_general_category (info, HB_UNICODE_GENERAL_CATEGORY_NON_SPACING_MARK);
}
}
static inline bool _hb_glyph_info_substituted (const hb_glyph_info_t *info);
@ -311,12 +338,15 @@ _hb_glyph_info_is_default_ignorable (const hb_glyph_info_t *info)
return (info->unicode_props() & UPROPS_MASK_IGNORABLE) &&
!_hb_glyph_info_substituted (info);
}
static inline bool
_hb_glyph_info_is_default_ignorable_and_not_hidden (const hb_glyph_info_t *info)
static inline void
_hb_glyph_info_clear_default_ignorable (hb_glyph_info_t *info)
{
return ((info->unicode_props() & (UPROPS_MASK_IGNORABLE|UPROPS_MASK_HIDDEN))
== UPROPS_MASK_IGNORABLE) &&
!_hb_glyph_info_substituted (info);
info->unicode_props() &= ~ UPROPS_MASK_IGNORABLE;
}
static inline bool
_hb_glyph_info_is_hidden (const hb_glyph_info_t *info)
{
return info->unicode_props() & UPROPS_MASK_HIDDEN;
}
static inline void
_hb_glyph_info_unhide (hb_glyph_info_t *info)

View file

@ -84,9 +84,9 @@ HB_INTERNAL bool postV2Tail::subset (hb_subset_context_t *c) const
old_gid_new_index_map.alloc (num_glyphs);
glyph_name_to_new_index.alloc (num_glyphs);
for (hb_codepoint_t new_gid = 0; new_gid < num_glyphs; new_gid++)
for (auto _ : c->plan->new_to_old_gid_list)
{
hb_codepoint_t old_gid = reverse_glyph_map.get (new_gid);
hb_codepoint_t old_gid = _.second;
unsigned old_index = glyphNameIndex[old_gid];
unsigned new_index;
@ -125,13 +125,22 @@ HB_INTERNAL bool postV2Tail::subset (hb_subset_context_t *c) const
old_gid_new_index_map.set (old_gid, new_index);
}
if (old_gid_new_index_map.in_error())
return_trace (false);
auto index_iter =
+ hb_range (num_glyphs)
| hb_map (reverse_glyph_map)
| hb_map_retains_sorting ([&](hb_codepoint_t old_gid)
| hb_map_retains_sorting ([&](hb_codepoint_t new_gid)
{
unsigned new_index = old_gid_new_index_map.get (old_gid);
return hb_pair_t<unsigned, unsigned> (old_gid, new_index);
hb_codepoint_t *old_gid;
/* use 0 for retain-gid holes, which refers to the name .notdef,
* as the glyphNameIndex entry for that glyph ID."*/
unsigned new_index = 0;
if (reverse_glyph_map.has (new_gid, &old_gid)) {
new_index = old_gid_new_index_map.get (*old_gid);
return hb_pair_t<unsigned, unsigned> (*old_gid, new_index);
}
return hb_pair_t<unsigned, unsigned> (new_gid, new_index);
})
;

View file

@ -301,7 +301,7 @@ struct post
return_trace (c->check_struct (this) &&
hb_barrier () &&
(version.to_int () == 0x00010000 ||
(version.to_int () == 0x00020000 && v2X.sanitize (c)) ||
(version.to_int () == 0x00020000 && hb_barrier () && v2X.sanitize (c)) ||
version.to_int () == 0x00030000));
}

View file

@ -153,7 +153,7 @@ decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shor
hb_codepoint_t u = buffer->cur().codepoint;
hb_codepoint_t glyph = 0;
if (shortest && c->font->get_nominal_glyph (u, &glyph, c->not_found))
if (shortest && c->font->get_nominal_glyph (u, &glyph, buffer->not_found))
{
next_char (buffer, glyph);
return;
@ -165,7 +165,7 @@ decompose_current_character (const hb_ot_shape_normalize_context_t *c, bool shor
return;
}
if (!shortest && c->font->get_nominal_glyph (u, &glyph, c->not_found))
if (!shortest && c->font->get_nominal_glyph (u, &glyph, buffer->not_found))
{
next_char (buffer, glyph);
return;
@ -220,6 +220,12 @@ handle_variation_selector_cluster (const hb_ot_shape_normalize_context_t *c,
/* Just pass on the two characters separately, let GSUB do its magic. */
set_glyph (buffer->cur(), font);
(void) buffer->next_glyph ();
buffer->scratch_flags |= HB_BUFFER_SCRATCH_FLAG_HAS_VARIATION_SELECTOR_FALLBACK;
_hb_glyph_info_set_variation_selector (&buffer->cur(), true);
if (buffer->not_found_variation_selector != HB_CODEPOINT_INVALID)
_hb_glyph_info_clear_default_ignorable (&buffer->cur());
set_glyph (buffer->cur(), font);
(void) buffer->next_glyph ();
}
@ -295,7 +301,8 @@ _hb_ot_shape_normalize (const hb_ot_shape_plan_t *plan,
buffer,
font,
buffer->unicode,
buffer->not_found,
plan->shaper->decompose ? plan->shaper->decompose : hb_ot_shape_normalize_context_t::decompose_unicode,
plan->shaper->compose ? plan->shaper->compose : hb_ot_shape_normalize_context_t::compose_unicode
};
c.override_decompose_and_compose (plan->shaper->decompose, plan->shaper->compose);

View file

@ -89,7 +89,6 @@ struct hb_ot_shape_normalize_context_t
hb_buffer_t *buffer;
hb_font_t *font;
hb_unicode_funcs_t *unicode;
const hb_codepoint_t not_found;
bool (*decompose) (const hb_ot_shape_normalize_context_t *c,
hb_codepoint_t ab,
hb_codepoint_t *a,

View file

@ -837,6 +837,28 @@ hb_ot_zero_width_default_ignorables (const hb_buffer_t *buffer)
pos[i].x_advance = pos[i].y_advance = pos[i].x_offset = pos[i].y_offset = 0;
}
static void
hb_ot_deal_with_variation_selectors (hb_buffer_t *buffer)
{
if (!(buffer->scratch_flags & HB_BUFFER_SCRATCH_FLAG_HAS_VARIATION_SELECTOR_FALLBACK) ||
buffer->not_found_variation_selector == HB_CODEPOINT_INVALID)
return;
unsigned int count = buffer->len;
hb_glyph_info_t *info = buffer->info;
hb_glyph_position_t *pos = buffer->pos;
for (unsigned int i = 0; i < count; i++)
{
if (_hb_glyph_info_is_variation_selector (&info[i]))
{
info[i].codepoint = buffer->not_found_variation_selector;
pos[i].x_advance = pos[i].y_advance = pos[i].x_offset = pos[i].y_offset = 0;
_hb_glyph_info_set_variation_selector (&info[i], false);
}
}
}
static void
hb_ot_hide_default_ignorables (hb_buffer_t *buffer,
hb_font_t *font)
@ -966,6 +988,7 @@ hb_ot_substitute_post (const hb_ot_shape_context_t *c)
hb_aat_layout_remove_deleted_glyphs (c->buffer);
#endif
hb_ot_deal_with_variation_selectors (c->buffer);
hb_ot_hide_default_ignorables (c->buffer, c->font);
if (c->plan->shaper->postprocess_glyphs &&

View file

@ -6,10 +6,10 @@
*
* on files with these headers:
*
* # ArabicShaping-15.1.0.txt
* # Date: 2023-01-05
* # Scripts-15.1.0.txt
* # Date: 2023-07-28, 16:01:07 GMT
* # ArabicShaping-16.0.0.txt
* # Date: 2024-07-30
* # Scripts-16.0.0.txt
* # Date: 2024-04-30, 21:48:40 GMT
*/
#ifndef HB_OT_SHAPER_ARABIC_JOINING_LIST_HH

View file

@ -6,10 +6,10 @@
*
* on files with these headers:
*
* # ArabicShaping-15.1.0.txt
* # Date: 2023-01-05
* # Blocks-15.1.0.txt
* # Date: 2023-07-28, 15:47:20 GMT
* # ArabicShaping-16.0.0.txt
* # Date: 2024-07-30
* # Blocks-16.0.0.txt
* # Date: 2024-02-02
* UnicodeData.txt does not have a header.
*/
@ -136,7 +136,13 @@ static const uint8_t joining_table[] =
/* 10D00 */ L,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 10D20 */ D,D,R,D,
#define joining_offset_0x10f30u 1182
#define joining_offset_0x10ec2u 1182
/* Arabic Extended-C */
/* 10EC0 */ R,D,D,
#define joining_offset_0x10f30u 1185
/* Sogdian */
@ -155,14 +161,14 @@ static const uint8_t joining_table[] =
/* 10FA0 */ D,U,D,D,R,R,R,U,D,R,R,D,D,R,D,D,
/* 10FC0 */ U,D,R,R,D,U,U,U,U,R,D,L,
#define joining_offset_0x110bdu 1338
#define joining_offset_0x110bdu 1341
/* Kaithi */
/* 110A0 */ U,X,X,
/* 110C0 */ X,X,X,X,X,X,X,X,X,X,X,X,X,U,
#define joining_offset_0x1e900u 1355
#define joining_offset_0x1e900u 1358
/* Adlam */
@ -170,7 +176,7 @@ static const uint8_t joining_table[] =
/* 1E920 */ D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,D,
/* 1E940 */ D,D,D,D,X,X,X,X,X,X,X,T,
}; /* Table items: 1431; occupancy: 57% */
}; /* Table items: 1434; occupancy: 57% */
static unsigned int
@ -198,6 +204,7 @@ joining_type (hb_codepoint_t u)
if (hb_in_range<hb_codepoint_t> (u, 0x10AC0u, 0x10AEFu)) return joining_table[u - 0x10AC0u + joining_offset_0x10ac0u];
if (hb_in_range<hb_codepoint_t> (u, 0x10B80u, 0x10BAFu)) return joining_table[u - 0x10B80u + joining_offset_0x10b80u];
if (hb_in_range<hb_codepoint_t> (u, 0x10D00u, 0x10D23u)) return joining_table[u - 0x10D00u + joining_offset_0x10d00u];
if (hb_in_range<hb_codepoint_t> (u, 0x10EC2u, 0x10EC4u)) return joining_table[u - 0x10EC2u + joining_offset_0x10ec2u];
if (hb_in_range<hb_codepoint_t> (u, 0x10F30u, 0x10FCBu)) return joining_table[u - 0x10F30u + joining_offset_0x10f30u];
break;

View file

@ -233,10 +233,7 @@ collect_features_arabic (hb_ot_shape_planner_t *plan)
map->enable_feature (HB_TAG('c','a','l','t'), F_MANUAL_ZWJ);
/* https://github.com/harfbuzz/harfbuzz/issues/1573 */
if (!map->has_feature (HB_TAG('r','c','l','t')))
{
map->add_gsub_pause (nullptr);
map->enable_feature (HB_TAG('r','c','l','t'), F_MANUAL_ZWJ);
}
map->enable_feature (HB_TAG('l','i','g','a'), F_MANUAL_ZWJ);
map->enable_feature (HB_TAG('c','l','i','g'), F_MANUAL_ZWJ);

View file

@ -6,12 +6,12 @@
*
* on files with these headers:
*
* # IndicSyllabicCategory-15.1.0.txt
* # Date: 2023-01-05
* # IndicPositionalCategory-15.1.0.txt
* # Date: 2023-01-05
* # Blocks-15.1.0.txt
* # Date: 2023-07-28, 15:47:20 GMT
* # IndicSyllabicCategory-16.0.0.txt
* # Date: 2024-04-30, 21:48:21 GMT
* # IndicPositionalCategory-16.0.0.txt
* # Date: 2024-04-30, 21:48:21 GMT
* # Blocks-16.0.0.txt
* # Date: 2024-02-02
*/
#include "hb.hh"
@ -89,7 +89,7 @@ static_assert (OT_VPst == M_Cat(VPst), "");
#define _OT_MW OT_MW /* 2 chars; MW */
#define _OT_MY OT_MY /* 3 chars; MY */
#define _OT_N OT_N /* 17 chars; N */
#define _OT_GB OT_PLACEHOLDER /* 165 chars; PLACEHOLDER */
#define _OT_GB OT_PLACEHOLDER /* 185 chars; PLACEHOLDER */
#define _OT_PT OT_PT /* 8 chars; PT */
#define _OT_R OT_Ra /* 14 chars; Ra */
#define _OT_Rf OT_Repha /* 1 chars; Repha */
@ -112,7 +112,7 @@ static_assert (OT_VPst == M_Cat(VPst), "");
#define _POS_A POS_AFTER_MAIN /* 3 chars; AFTER_MAIN */
#define _POS_AP POS_AFTER_POST /* 50 chars; AFTER_POST */
#define _POS_AS POS_AFTER_SUB /* 51 chars; AFTER_SUB */
#define _POS_C POS_BASE_C /* 833 chars; BASE_C */
#define _POS_C POS_BASE_C /* 853 chars; BASE_C */
#define _POS_BS POS_BEFORE_SUB /* 25 chars; BEFORE_SUB */
#define _POS_B POS_BELOW_C /* 13 chars; BELOW_C */
#define _POS_X POS_END /* 71 chars; END */
@ -458,7 +458,16 @@ static const uint16_t indic_table[] = {
/* 11338 */ _(X,X), _(X,X), _(X,X), _(N,X), _(N,X), _(X,X), _(X,X), _(X,X),
}; /* Table items: 1728; occupancy: 71% */
#define indic_offset_0x116d0u 1728
/* Myanmar Extended-C */
/* 116D0 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C),
/* 116D8 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(GB,C),
/* 116E0 */ _(GB,C), _(GB,C), _(GB,C), _(GB,C), _(X,X), _(X,X), _(X,X), _(X,X),
}; /* Table items: 1752; occupancy: 71% */
uint16_t
hb_indic_get_categories (hb_codepoint_t u)
@ -498,6 +507,7 @@ hb_indic_get_categories (hb_codepoint_t u)
case 0x11u:
if (hb_in_range<hb_codepoint_t> (u, 0x11300u, 0x11307u)) return indic_table[u - 0x11300u + indic_offset_0x11300u];
if (hb_in_range<hb_codepoint_t> (u, 0x11338u, 0x1133Fu)) return indic_table[u - 0x11338u + indic_offset_0x11338u];
if (hb_in_range<hb_codepoint_t> (u, 0x116D0u, 0x116E7u)) return indic_table[u - 0x116D0u + indic_offset_0x116d0u];
break;
default:

View file

@ -6,18 +6,18 @@
*
* on files with these headers:
*
* # IndicSyllabicCategory-15.1.0.txt
* # Date: 2023-01-05
* # IndicPositionalCategory-15.1.0.txt
* # Date: 2023-01-05
* # ArabicShaping-15.1.0.txt
* # Date: 2023-01-05
* # DerivedCoreProperties-15.1.0.txt
* # Date: 2023-08-07, 15:21:24 GMT
* # Blocks-15.1.0.txt
* # Date: 2023-07-28, 15:47:20 GMT
* # Scripts-15.1.0.txt
* # Date: 2023-07-28, 16:01:07 GMT
* # IndicSyllabicCategory-16.0.0.txt
* # Date: 2024-04-30, 21:48:21 GMT
* # IndicPositionalCategory-16.0.0.txt
* # Date: 2024-04-30, 21:48:21 GMT
* # ArabicShaping-16.0.0.txt
* # Date: 2024-07-30
* # DerivedCoreProperties-16.0.0.txt
* # Date: 2024-05-31, 18:09:32 GMT
* # Blocks-16.0.0.txt
* # Date: 2024-02-02
* # Scripts-16.0.0.txt
* # Date: 2024-04-30, 21:48:40 GMT
* # Override values For Indic_Syllabic_Category
* # Not derivable
* # Initial version based on Unicode 7.0 by Andrew Glass 2014-03-17
@ -27,6 +27,7 @@
* # Updated for Unicode 14.0 by Andrew Glass 2021-09-25
* # Updated for Unicode 15.0 by Andrew Glass 2022-09-16
* # Updated for Unicode 15.1 by Andrew Glass 2023-09-14
* # Updated for Unicode 16.0 by Andrew Glass 2024-09-11
* # Override values For Indic_Positional_Category
* # Not derivable
* # Initial version based on Unicode 7.0 by Andrew Glass 2014-03-17
@ -38,6 +39,7 @@
* # Updated for Unicode 14.0 by Andrew Glass 2021-09-28
* # Updated for Unicode 15.0 by Andrew Glass 2022-09-16
* # Updated for Unicode 15.1 by Andrew Glass 2023-09-14
* # Updated for Unicode 16.0 by Andrew Glass 2024-09-11
* UnicodeData.txt does not have a header.
*/
@ -65,6 +67,7 @@
#define N USE(N) /* BASE_NUM */
#define O USE(O) /* OTHER */
#define R USE(R) /* REPHA */
#define RK USE(RK) /* REORDERING_KILLER */
#define SB USE(SB) /* HIEROGLYPH_SEGMENT_BEGIN */
#define SE USE(SE) /* HIEROGLYPH_SEGMENT_END */
#define SUB USE(SUB) /* CONS_SUB */
@ -99,16 +102,16 @@
#ifndef HB_OPTIMIZE_SIZE
static const uint8_t
hb_use_u8[3187] =
hb_use_u8[3345] =
{
16, 50, 51, 51, 51, 52, 51, 83, 118, 131, 51, 57, 58, 179, 195, 61,
16, 50, 51, 51, 51, 52, 51, 83, 118, 131, 57, 58, 59, 195, 211, 62,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
14, 0, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 4, 2, 2,
15, 0, 1, 2, 2, 2, 2, 3, 2, 2, 2, 2, 2, 4, 2, 2,
5, 6, 2, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 2, 2, 17,
18, 19, 20, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 21,
22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 2, 33, 2, 2, 2,
@ -121,24 +124,26 @@ hb_use_u8[3187] =
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 47, 48, 2,
49, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 50, 51, 2, 2, 2,
2, 2, 2, 2, 2, 52, 53, 2, 54, 2, 2, 55, 2, 2, 56, 57,
58, 59, 60, 61, 62, 63, 64, 65, 2, 66, 67, 2, 68, 69, 70, 71,
2, 72, 2, 73, 74, 75, 76, 2, 2, 77, 78, 79, 80, 2, 81, 82,
2, 83, 83, 83, 83, 83, 83, 83, 83, 84, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 52, 53, 2, 54, 2, 2, 55, 56, 2, 57, 58,
59, 60, 61, 62, 63, 64, 65, 66, 67, 68, 69, 2, 70, 71, 72, 73,
2, 74, 2, 75, 76, 77, 78, 2, 2, 79, 80, 81, 82, 2, 83, 84,
2, 85, 85, 85, 85, 85, 85, 85, 85, 86, 85, 85, 85, 85, 85, 85,
85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85, 85,
85, 85, 85, 85, 85, 85, 85, 85, 87, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 88, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 89, 90, 2, 2, 2, 91, 2, 2, 2, 92,
93, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 94, 94, 94, 95, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 85, 86, 2, 2, 2, 2, 2, 2, 2, 87,
88, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 89, 89, 89, 90, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 96, 97, 2, 2, 2, 2, 2,
2, 2, 2, 98, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 91, 92, 2, 2, 2, 2, 2,
2, 2, 2, 93, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 2, 2, 94, 2, 2, 95, 2, 2, 2, 96, 2, 2, 2, 2, 2,
2, 2, 2, 97, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 98, 98, 99, 100, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98, 98,
98, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
2, 2, 2, 99, 2, 2, 100, 2, 2, 2, 101, 2, 102, 2, 2, 2,
2, 2, 2, 103, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
2, 104, 104, 105, 106, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104, 104,
104, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1,
0, 2, 2, 2, 2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 3, 4,
0, 5, 0, 0, 0, 0, 0, 6, 0, 0, 7, 0, 0, 0, 0, 0,
0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
@ -167,7 +172,7 @@ hb_use_u8[3187] =
0, 0, 0, 27, 31, 2, 9, 0, 0, 10, 29, 30, 2, 2, 2, 9,
2, 2, 2, 30, 2, 2, 0, 17, 45, 0, 0, 35, 47, 0, 0, 0,
9, 50, 51, 0, 0, 0, 0, 0, 0, 11, 29, 2, 2, 2, 2, 9,
2, 2, 2, 2, 2, 2, 52, 53, 23, 23, 19, 31, 48, 33, 48, 34,
2, 2, 2, 2, 2, 2, 52, 53, 23, 19, 20, 31, 48, 33, 48, 34,
54, 0, 0, 0, 35, 0, 0, 0, 30, 12, 29, 30, 2, 2, 2, 2,
2, 2, 2, 2, 9, 0, 2, 2, 2, 2, 30, 2, 2, 2, 2, 30,
0, 2, 2, 2, 9, 0, 55, 0, 35, 23, 22, 31, 31, 18, 48, 48,
@ -195,9 +200,9 @@ hb_use_u8[3187] =
0, 2, 2, 100, 101, 102, 103, 61, 63, 104, 16, 45, 22, 59, 21, 80,
48, 48, 76, 11, 11, 11, 105, 46, 40, 11, 106, 74, 2, 2, 2, 2,
2, 2, 2, 107, 22, 20, 20, 22, 48, 48, 22, 108, 2, 2, 2, 9,
0, 0, 0, 0, 0, 0, 109, 110, 111, 111, 111, 0, 0, 0, 0, 0,
0, 106, 74, 2, 2, 2, 2, 2, 2, 60, 61, 59, 25, 22, 112, 61,
2, 2, 2, 2, 107, 22, 23, 45, 45, 102, 14, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 109, 110, 110, 110, 110, 0, 0, 0, 0, 0,
0, 106, 74, 2, 2, 2, 2, 2, 2, 60, 61, 59, 25, 22, 111, 61,
2, 2, 2, 2, 107, 22, 23, 45, 45, 102, 112, 0, 0, 0, 0, 0,
0, 2, 2, 61, 18, 48, 23, 113, 102, 102, 102, 114, 115, 0, 0, 0,
0, 2, 2, 2, 2, 2, 0, 30, 2, 11, 46, 116, 116, 116, 11, 116,
116, 15, 116, 116, 116, 26, 0, 40, 0, 0, 0, 117, 51, 11, 5, 0,
@ -226,6 +231,7 @@ hb_use_u8[3187] =
146, 2, 2, 30, 2, 30, 2, 2, 2, 2, 2, 2, 0, 14, 37, 0,
147, 2, 2, 13, 37, 0, 30, 2, 2, 2, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 30, 2, 2, 9, 2, 2, 11, 41, 0, 0, 0,
0, 2, 2, 2, 0, 27, 22, 22, 30, 2, 2, 2, 0, 0, 0, 0,
0, 2, 2, 2, 2, 2, 27, 38, 0, 2, 2, 2, 116, 116, 116, 116,
116, 148, 2, 9, 0, 0, 0, 0, 0, 2, 14, 14, 0, 0, 0, 0,
0, 9, 2, 2, 9, 2, 2, 2, 2, 30, 2, 9, 0, 30, 2, 0,
@ -244,39 +250,45 @@ hb_use_u8[3187] =
0, 11, 11, 30, 2, 2, 2, 9, 30, 9, 2, 30, 2, 2, 58, 17,
23, 16, 23, 47, 32, 33, 32, 34, 0, 0, 0, 0, 35, 0, 0, 0,
2, 2, 23, 0, 11, 11, 11, 46, 0, 11, 11, 46, 0, 0, 0, 0,
0, 2, 2, 65, 25, 20, 20, 20, 22, 23, 126, 15, 17, 0, 0, 0,
0, 2, 2, 2, 2, 2, 0, 0, 163, 164, 0, 0, 0, 0, 0, 0,
0, 18, 19, 20, 20, 66, 99, 25, 160, 11, 165, 9, 0, 0, 0, 0,
0, 2, 2, 2, 2, 2, 2, 2, 65, 25, 20, 20, 0, 48, 48, 11,
166, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 20,
0, 23, 19, 20, 20, 21, 16, 82, 166, 38, 0, 0, 0, 0, 0, 0,
0, 2, 2, 2, 2, 2, 10, 167, 25, 20, 22, 22, 165, 9, 0, 0,
0, 2, 2, 2, 2, 2, 9, 43, 136, 23, 22, 20, 76, 21, 22, 0,
0, 2, 2, 2, 9, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 18,
19, 20, 21, 22, 105, 166, 37, 0, 0, 2, 2, 2, 9, 30, 0, 2,
2, 2, 2, 30, 9, 2, 2, 2, 2, 23, 23, 18, 32, 33, 12, 168,
169, 170, 171, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 2, 2,
2, 65, 25, 20, 20, 0, 22, 23, 29, 108, 0, 33, 0, 0, 0, 0,
0, 52, 20, 22, 22, 22, 140, 2, 2, 2, 172, 173, 11, 15, 174, 72,
175, 0, 0, 1, 147, 0, 0, 0, 0, 52, 20, 22, 16, 19, 20, 2,
2, 2, 2, 158, 158, 158, 176, 176, 176, 176, 176, 176, 15, 177, 0, 30,
0, 22, 20, 20, 31, 22, 22, 11, 166, 0, 61, 61, 61, 61, 61, 61,
61, 66, 21, 82, 46, 0, 0, 0, 0, 2, 2, 2, 9, 2, 30, 2,
2, 52, 22, 22, 31, 0, 38, 22, 27, 11, 159, 178, 174, 0, 0, 0,
0, 2, 2, 2, 30, 9, 2, 2, 2, 2, 2, 2, 2, 2, 23, 23,
47, 22, 35, 82, 68, 0, 0, 0, 0, 2, 179, 66, 47, 0, 0, 0,
0, 11, 180, 2, 2, 2, 2, 2, 2, 2, 2, 23, 22, 20, 31, 0,
48, 16, 143, 0, 0, 0, 0, 0, 0, 181, 181, 181, 181, 181, 181, 181,
181, 182, 182, 182, 183, 184, 182, 181, 181, 185, 181, 181, 186, 187, 187, 187,
187, 187, 187, 187, 0, 0, 0, 0, 0, 11, 11, 11, 46, 0, 0, 0,
0, 2, 2, 2, 2, 2, 9, 0, 58, 188, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0,
40, 116, 26, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
0, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 58,
37, 0, 6, 120, 120, 120, 121, 0, 0, 11, 11, 11, 49, 2, 2, 2,
0, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2,
46, 2, 2, 2, 2, 2, 2, 11, 11, 2, 2, 2, 2, 2, 2, 22,
22, 2, 2, 44, 44, 44, 92, 0, 0, O, O, O, GB, B, B, O,
0, 2, 2, 2, 2, 2, 30, 0, 9, 2, 2, 2, 30, 45, 59, 20,
20, 31, 33, 32, 32, 25, 163, 29, 164, 165, 37, 0, 0, 0, 0, 0,
0, 12, 26, 0, 0, 0, 0, 0, 0, 2, 2, 65, 25, 20, 20, 20,
22, 23, 126, 15, 17, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0,
166, 167, 0, 0, 0, 0, 0, 0, 0, 18, 19, 20, 20, 66, 99, 25,
160, 11, 168, 9, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2,
65, 25, 20, 20, 0, 48, 48, 11, 169, 37, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 2, 20, 0, 23, 19, 20, 20, 21, 16, 82,
169, 38, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 10, 170,
25, 20, 22, 22, 168, 9, 0, 0, 0, 2, 2, 2, 2, 2, 9, 43,
136, 23, 22, 20, 76, 21, 22, 0, 0, 2, 2, 2, 9, 0, 0, 0,
0, 2, 2, 2, 2, 2, 2, 18, 19, 20, 21, 22, 105, 169, 37, 0,
0, 2, 2, 2, 9, 30, 0, 2, 2, 2, 2, 30, 9, 2, 2, 2,
2, 23, 23, 18, 32, 33, 12, 171, 165, 172, 173, 0, 0, 0, 0, 0,
0, 2, 2, 2, 2, 0, 2, 2, 2, 65, 25, 20, 20, 0, 22, 23,
29, 108, 0, 33, 0, 0, 0, 0, 0, 52, 20, 22, 22, 22, 140, 2,
2, 2, 174, 175, 11, 15, 176, 61, 177, 0, 0, 1, 147, 0, 0, 0,
0, 52, 20, 22, 16, 19, 20, 2, 2, 2, 2, 158, 158, 158, 178, 178,
178, 178, 178, 178, 15, 179, 0, 30, 0, 22, 20, 20, 31, 22, 22, 11,
169, 0, 61, 61, 61, 61, 61, 61, 61, 66, 21, 82, 46, 0, 0, 0,
0, 2, 2, 2, 9, 2, 30, 2, 2, 52, 22, 22, 31, 0, 38, 22,
27, 11, 159, 180, 181, 0, 0, 0, 0, 2, 2, 2, 30, 9, 2, 2,
2, 2, 2, 2, 2, 2, 23, 23, 47, 22, 35, 82, 68, 0, 0, 0,
0, 2, 182, 66, 47, 0, 0, 0, 0, 11, 183, 2, 2, 2, 2, 2,
2, 2, 2, 23, 22, 20, 31, 0, 48, 16, 143, 0, 0, 0, 0, 0,
0, 2, 2, 2, 2, 2, 156, 0, 0, 184, 184, 184, 184, 184, 184, 184,
184, 185, 185, 185, 186, 187, 185, 184, 184, 188, 184, 184, 189, 190, 190, 190,
190, 190, 190, 190, 0, 0, 0, 0, 0, 184, 184, 184, 184, 184, 191, 0,
0, 2, 2, 2, 2, 2, 2, 2, 22, 22, 22, 22, 22, 22, 192, 193,
194, 11, 11, 11, 46, 0, 0, 0, 0, 29, 74, 2, 2, 2, 2, 2,
2, 2, 2, 2, 2, 2, 65, 47, 0, 2, 2, 2, 2, 2, 9, 0,
58, 195, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 0, 0, 0, 40, 116, 26, 0, 0, 0, 0, 0,
0, 0, 0, 9, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
30, 2, 2, 2, 2, 2, 0, 58, 37, 0, 6, 120, 120, 120, 121, 0,
0, 11, 11, 11, 49, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 0,
2, 2, 2, 2, 2, 2, 2, 2, 46, 2, 2, 2, 2, 2, 2, 11,
11, 2, 2, 2, 2, 2, 2, 22, 22, 2, 2, 2, 2, 2, 2, 2,
20, 2, 2, 44, 44, 44, 92, 0, 0, O, O, O, GB, B, B, O,
SB, O, SE, GB, O, O, WJ,FMPst,FMPst, O, CGJ, B, O, B,VMAbv,VMAbv,
VMAbv, O,VMAbv, B,CMBlw,CMBlw,CMBlw,VMAbv,VMPst, VAbv, VPst,CMBlw, B, VPst, VPre, VPst,
VBlw, VBlw, VBlw, VBlw, VAbv, VAbv, VAbv, VPst, VPst, VPst, H, VPre, VPst,VMBlw, O, O,
@ -290,20 +302,21 @@ hb_use_u8[3187] =
FMAbv, FAbv,CMAbv,FMAbv,VMAbv,FMAbv, VAbv, IS,FMAbv, B,FMAbv, B, CGJ, WJ, CGJ, GB,
CMAbv,CMAbv, B, GB, B, VAbv, SUB, FPst, FPst,VMBlw, FPst, FPst, FBlw,VMAbv,FMBlw, VAbv,
VPre, B, MPre, MBlw, SUB, FAbv, FAbv, MAbv, SUB, Sk, VPst, VAbv,VMAbv,VMAbv, FAbv,CMAbv,
VPst, H, B, O,SMAbv,SMBlw,SMAbv,SMAbv,SMAbv, VPst, IS, VBlw, FAbv,VMPre,VMPre,FMAbv,
VPst, H, B, O,SMAbv,SMAbv,SMAbv, VPst, IS, RK, RK, VBlw, FAbv,VMPre,VMPre,FMAbv,
CMBlw,VMBlw,VMBlw,VMAbv, CS, O,FMAbv, ZWNJ, CGJ, WJ, WJ, WJ, O,FMPst, O, SB,
SE, O, H, MPst, VPst, H,VMAbv, VAbv,VMBlw, B, VBlw, FPst, VPst, FAbv,VMPst, B,
CMAbv, VAbv, MBlw, MPst, MBlw, H, O, VBlw, MPst, MPre, MAbv, MBlw, O, B, FAbv, FAbv,
FPst, VBlw, B, B, VPre, O,VMPst, IS, O,VMPst, VBlw, VPst,VMBlw,VMBlw,VMAbv, O,
IS,VMBlw, B,VMPst,VMAbv,VMPst, CS, CS, B, N, N, O, HN, VPre, VBlw, VAbv,
IS,CMAbv, O, VPst, B, R, R,CMBlw, VAbv, VPre,VMAbv,VMAbv, H, VAbv,CMBlw,FMAbv,
B, CS, CS, H,CMBlw,VMPst, H,VMPst, VAbv,VMAbv, VPst, IS, R, MPst, R, MPst,
CMBlw, B,FMBlw, VBlw,VMAbv, R, MBlw, MBlw, GB, FBlw, FBlw,CMAbv, IS, VBlw, IS, GB,
VAbv, R,VMPst, G, G, J, J, J, SB, SE, J, HR, G, G, HM, HM,
HM, O, VBlw,
IS,CMAbv, O, VPst, B, R, R,CMBlw, VAbv, VPre,VMAbv,VMAbv, H, VAbv,CMBlw,VMPst,
O,VMAbv,CMBlw, IS, R,FMAbv, B, CS, CS, H,CMBlw,VMPst, H,VMPst, VAbv,VMAbv,
VPst, MPst, R, MPst,CMBlw, B,FMBlw, VBlw,VMAbv, CS, SUB, SUB, GB, FBlw, FBlw,CMAbv,
IS, VBlw, IS, R, MBlw, GB, VAbv, R,VMPst, G, G, J, J, J, SB, SE,
J, HR, G, G, HM, HM, HM, G, O, MPre, MPre, MPst,VMAbv, MBlw, VBlw, O,
VBlw,
};
static const uint16_t
hb_use_u16[808] =
hb_use_u16[856] =
{
0, 0, 1, 2, 0, 3, 0, 3, 0, 0, 4, 5, 0, 6, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 7, 0, 0, 0,
@ -332,28 +345,31 @@ hb_use_u16[808] =
0, 0, 0, 0, 0, 0, 0,164, 0, 0, 0, 0, 0, 0, 0,165,
0, 0, 0, 0, 0, 0, 0,166,166,167, 34,168, 0, 0, 0, 0,
169,170, 10,171, 95, 0, 0, 0, 0, 0, 0, 0, 70, 10,172, 0,
10,173,174, 0, 0, 0, 0, 0, 10, 10,175, 2, 0, 0, 0, 0,
10, 10,176,173, 0, 0, 0, 0, 0, 0, 0, 10,177,178, 0, 10,
179, 0, 0,180,181, 0, 0, 0,182, 10, 10,183,184,185,186,187,
188, 10, 10,189,190, 0, 0, 0,191, 10,192,193,194, 10, 10,195,
188, 10, 10,196,197,106,198,103, 10, 34,199,200,201, 0, 0, 0,
202,203, 95, 10, 10,204,205, 2,206, 21, 22,207,208,209,210,211,
10, 10, 10,212,213,214,215, 0,198, 10, 10,216,217, 2, 0, 0,
10, 10,218,219,220,221, 0, 0, 10, 10, 10,222,223, 2, 0, 0,
10, 10,224,225, 2, 0, 0, 0, 10,226,227,104,228, 0, 0, 0,
10, 10,229,230, 0, 0, 0, 0,231,232, 10,233,234, 2, 0, 0,
0, 0,235, 10, 10,236,237, 0,238, 10, 10,239,240,241, 10, 10,
242,243, 0, 0, 0, 0, 0, 0, 22, 10,218,244, 8, 10, 71, 19,
10,245, 74,246, 0, 0, 0, 0,247, 10, 10,248,249, 2,250, 10,
251,252, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,253,
254, 49, 10,255,256, 2, 0, 0,257,257,257,257,257,257,257,257,
257,257,257,258,259,260, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
10, 10, 10,261, 0, 0, 0, 0, 10, 10, 10, 10,262,263,264,264,
265,266, 0, 0, 0, 0,267, 0, 10, 10, 10, 10, 10, 10, 10, 10,
10, 10, 10, 10, 10,268, 0, 0, 10, 10, 10, 10, 10, 10,106, 71,
95,269, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,270,
10, 10, 71,271,272, 0, 0, 0, 0, 10,273, 0, 10, 10,274, 2,
0, 0, 0, 0, 0, 10,275, 2, 10, 10, 10, 10,276, 2, 0, 0,
10,173,174, 0, 0, 0, 0, 0, 10, 10,175, 2, 9, 10,176, 10,
177, 0, 0, 0, 0, 0, 0, 0, 10, 10,178,173, 0, 0, 0, 0,
0, 0, 0, 10,179,180, 0, 10,181, 0, 0,182,183, 0, 0, 0,
184, 10, 10,185,186,187,188,189,190, 10, 10,191,192, 0, 0, 0,
193, 10,194,195,196, 10, 10,197,190, 10, 10,198,199,106,200,103,
10, 34,201,202,203, 0, 0, 0,204,205, 95, 10, 10,206,207, 2,
208, 21, 22,209,210,211,212,213,214, 10, 10,215,216,217,218, 0,
10, 10, 10,219,220,221,222, 0,200, 10, 10,223,224, 2, 0, 0,
10, 10,225,226,227,228, 0, 0, 10, 10, 10,229,230, 2, 0, 0,
10, 10,231,232, 2, 10,141, 0, 10,233,234,104,235, 0, 0, 0,
10, 10,236,237, 0, 0, 0, 0,238,239, 10,240,241, 2, 0, 0,
0, 0,242, 10, 10,243,244, 0,245, 10, 10,246,247,248, 10, 10,
249,250, 0, 0, 0, 0, 0, 0, 22, 10,225,251, 8, 10, 71, 19,
10,252, 74,253, 0, 0, 0, 0,254, 10, 10,255,256, 2,257, 10,
258,259, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 10,260,
261, 49, 10,262,263,264, 0, 0,265,265,265,265,265,265,265,265,
265,265,265,266,267,268,265,265,265,265,265,265,265,265,265,269,
10,270,271, 2, 0, 0, 0, 0, 0, 0, 0, 0, 2, 0, 0, 0,
10, 10, 10,272, 0, 0, 0, 0, 0, 0, 0, 0,273, 10,274, 2,
10, 10, 10, 10,275,276,277,277,278,279, 0, 0, 0, 0,280, 0,
10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10, 10,177, 0,281,
10, 10, 10, 10, 10, 10,106, 71, 95,282, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0,283, 10, 10, 71,284,285, 0, 0, 0,
0, 10,286, 0, 10, 10,287, 2, 0, 0, 0, 0, 0, 10,288, 2,
0, 0, 0, 0, 0, 10,289,106, 10, 10, 10, 10,290, 2, 0, 0,
130,130,130,130,130,130,130,130,163,163,163,163,163,163,163,163,
163,163,163,163,163,163,163,130,
};
@ -366,23 +382,23 @@ hb_use_b4 (const uint8_t* a, unsigned i)
static inline uint_fast8_t
hb_use_get_category (unsigned u)
{
return u<921600u?hb_use_u8[2809+(((hb_use_u8[593+(((hb_use_u16[((hb_use_u8[113+(((hb_use_b4(hb_use_u8,u>>1>>3>>3>>5))<<5)+((u>>1>>3>>3)&31u))])<<3)+((u>>1>>3)&7u)])<<3)+((u>>1)&7u))])<<1)+((u)&1u))]:O;
return u<921600u?hb_use_u8[2953+(((hb_use_u8[625+(((hb_use_u16[((hb_use_u8[113+(((hb_use_b4(hb_use_u8,u>>1>>3>>3>>5))<<5)+((u>>1>>3>>3)&31u))])<<3)+((u>>1>>3)&7u)])<<3)+((u>>1)&7u))])<<1)+((u)&1u))]:O;
}
#else
static const uint8_t
hb_use_u8[3483] =
hb_use_u8[3657] =
{
16, 50, 51, 51, 51, 52, 51, 83, 118, 131, 51, 57, 58, 179, 195, 61,
16, 50, 51, 51, 51, 52, 51, 83, 118, 131, 57, 58, 59, 195, 211, 62,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51, 51,
14, 0, 1, 1, 2, 1, 1, 3, 4, 5, 6, 7, 8, 9, 10, 1,
15, 0, 1, 1, 2, 1, 1, 3, 4, 5, 6, 7, 8, 9, 10, 1,
11, 12, 1, 1, 1, 1, 1, 1, 13, 14, 15, 16, 17, 18, 19, 1,
1, 20, 1, 1, 1, 1, 21, 1, 22, 1, 1, 1, 1, 1, 23, 24,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
@ -390,14 +406,15 @@ hb_use_u8[3483] =
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 29,
30, 1, 1, 1, 1, 1, 31, 1, 1, 1, 1, 32, 33, 1, 34, 35,
36, 37, 38, 39, 40, 41, 42, 43, 44, 45, 46, 47, 1, 48, 49, 50,
51, 52, 52, 52, 52, 53, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 54, 55, 1, 1, 1,
56, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 57, 58, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 59, 1, 1,
1, 1, 60, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 61, 62, 1, 63, 1, 1, 1, 1, 64, 1, 1, 1, 1, 1,
1, 65, 66, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65, 65,
65, 0, 1, 2, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0,
51, 52, 52, 52, 52, 53, 52, 52, 52, 52, 52, 52, 52, 52, 52, 52,
52, 52, 52, 52, 54, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 55, 1, 1, 1, 1, 1, 1, 1, 1, 56, 57, 1, 58, 1,
59, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 60, 61, 1, 1,
1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 62, 1, 1,
1, 1, 63, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
1, 1, 64, 65, 1, 66, 67, 1, 1, 1, 68, 1, 1, 1, 1, 1,
1, 69, 70, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69, 69,
69, 0, 1, 2, 2, 0, 3, 4, 0, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 5, 0, 0, 0, 0, 0, 0, 0, 6, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 7, 8, 0, 0, 9, 0, 0, 0, 0,
0, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20, 21, 22, 23, 24,
@ -414,23 +431,25 @@ hb_use_u8[3483] =
122, 0, 0, 0, 0, 0, 0, 56, 123, 124, 0, 0, 0, 0, 0, 0,
125, 0, 0, 0, 0, 0, 0, 0, 126, 0, 0, 0, 127, 128, 129, 0,
0, 130, 131, 132, 0, 0, 0, 51, 133, 0, 0, 0, 0, 134, 135, 0,
0, 56, 136, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 56, 137, 0,
0, 0, 101, 138, 101, 139, 140, 141, 0, 142, 143, 144, 145, 146, 147, 148,
0, 149, 150, 151, 152, 146, 153, 154, 155, 156, 157, 158, 0, 159, 160, 161,
162, 163, 164, 165, 166, 0, 0, 0, 0, 56, 167, 168, 169, 170, 171, 172,
0, 0, 0, 0, 0, 56, 173, 174, 0, 56, 175, 176, 0, 56, 177, 67,
0, 178, 179, 180, 0, 0, 0, 0, 0, 56, 181, 0, 0, 0, 0, 0,
0, 182, 183, 184, 0, 0, 185, 186, 187, 188, 189, 190, 56, 191, 0, 0,
0, 192, 193, 194, 195, 196, 197, 0, 0, 198, 199, 200, 201, 202, 67, 0,
0, 0, 0, 0, 0, 0, 0, 0, 203, 204, 205, 206, 0, 0, 0, 0,
0, 207, 207, 207, 207, 207, 207, 207, 207, 207, 208, 209, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 67, 0, 56, 210, 0, 0, 0, 0, 0,
0, 56, 56, 211, 212, 213, 0, 0, 214, 56, 56, 56, 56, 56, 56, 56,
56, 56, 56, 56, 56, 56, 56, 215, 0, 56, 56, 56, 216, 217, 0, 0,
0, 0, 0, 0, 218, 0, 0, 0, 0, 56, 219, 220, 0, 0, 0, 0,
0, 0, 0, 0, 0, 101, 221, 56, 222, 0, 0, 0, 0, 0, 0, 101,
223, 56, 56, 224, 0, 0, 0, 0, 0, 225, 225, 225, 225, 225, 225, 225,
225, 226, 226, 226, 226, 226, 226, 226, 227, 0, 0, 0, 0, 0, 0, 0,
0, 56, 136, 7, 137, 138, 0, 0, 0, 0, 0, 0, 0, 56, 139, 0,
0, 0, 101, 140, 101, 141, 142, 143, 0, 144, 145, 146, 147, 148, 149, 150,
0, 151, 152, 153, 154, 148, 155, 156, 157, 158, 159, 160, 0, 161, 162, 163,
164, 165, 166, 167, 168, 169, 170, 171, 172, 56, 173, 174, 175, 176, 177, 178,
0, 0, 0, 0, 0, 56, 179, 180, 0, 56, 181, 182, 0, 56, 183, 184,
185, 186, 187, 188, 0, 0, 0, 0, 0, 56, 189, 0, 0, 0, 0, 0,
0, 190, 191, 192, 0, 0, 193, 194, 195, 196, 197, 198, 56, 199, 0, 0,
0, 200, 201, 202, 203, 204, 205, 0, 0, 206, 207, 208, 209, 210, 67, 0,
0, 0, 0, 0, 0, 0, 0, 0, 211, 212, 213, 214, 0, 0, 0, 0,
0, 215, 215, 215, 215, 215, 215, 215, 215, 215, 216, 217, 215, 215, 215, 215,
215, 215, 215, 215, 215, 215, 215, 215, 218, 219, 220, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 67, 0, 56, 221, 0, 0, 0, 0, 0,
0, 0, 0, 222, 223, 0, 0, 0, 0, 56, 56, 224, 225, 226, 0, 0,
227, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 56, 228,
229, 56, 56, 56, 230, 231, 0, 0, 0, 0, 0, 0, 232, 0, 0, 0,
0, 56, 233, 234, 0, 0, 0, 0, 0, 0, 0, 0, 0, 101, 235, 56,
236, 0, 0, 0, 0, 0, 0, 101, 237, 0, 0, 0, 0, 0, 0, 101,
238, 56, 56, 239, 0, 0, 0, 0, 0, 240, 240, 240, 240, 240, 240, 240,
240, 241, 241, 241, 241, 241, 241, 241, 242, 0, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 1, 0, 2, 2, 2, 2, 2, 0, 0,
0, 0, 0, 0, 0, 0, 3, 4, 0, 5, 0, 0, 0, 0, 0, 6,
0, 0, 7, 0, 0, 0, 0, 0, 0, 0, 0, 0, 1, 0, 0, 0,
@ -460,7 +479,7 @@ hb_use_u8[3483] =
0, 10, 29, 30, 2, 2, 2, 9, 2, 2, 2, 30, 2, 2, 0, 17,
45, 0, 0, 35, 47, 0, 0, 0, 9, 50, 51, 0, 0, 0, 0, 0,
0, 11, 29, 2, 2, 2, 2, 9, 2, 2, 2, 2, 2, 2, 52, 53,
23, 23, 19, 31, 48, 33, 48, 34, 54, 0, 0, 0, 35, 0, 0, 0,
23, 19, 20, 31, 48, 33, 48, 34, 54, 0, 0, 0, 35, 0, 0, 0,
30, 12, 29, 30, 2, 2, 2, 2, 2, 2, 2, 2, 9, 0, 2, 2,
2, 2, 30, 2, 2, 2, 2, 30, 0, 2, 2, 2, 9, 0, 55, 0,
35, 23, 22, 31, 31, 18, 48, 48, 25, 0, 23, 0, 0, 0, 0, 0,
@ -488,9 +507,9 @@ hb_use_u8[3483] =
63, 104, 16, 45, 22, 59, 21, 80, 48, 48, 76, 11, 11, 11, 105, 46,
40, 11, 106, 74, 2, 2, 2, 2, 2, 2, 2, 107, 22, 20, 20, 22,
48, 48, 22, 108, 2, 2, 2, 9, 0, 0, 0, 0, 0, 0, 109, 110,
111, 111, 111, 0, 0, 0, 0, 0, 0, 106, 74, 2, 2, 2, 2, 2,
2, 60, 61, 59, 25, 22, 112, 61, 2, 2, 2, 2, 107, 22, 23, 45,
45, 102, 14, 0, 0, 0, 0, 0, 0, 2, 2, 61, 18, 48, 23, 113,
110, 110, 110, 0, 0, 0, 0, 0, 0, 106, 74, 2, 2, 2, 2, 2,
2, 60, 61, 59, 25, 22, 111, 61, 2, 2, 2, 2, 107, 22, 23, 45,
45, 102, 112, 0, 0, 0, 0, 0, 0, 2, 2, 61, 18, 48, 23, 113,
102, 102, 102, 114, 115, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 30,
2, 11, 46, 116, 116, 116, 11, 116, 116, 15, 116, 116, 116, 26, 0, 40,
0, 0, 0, 117, 51, 11, 5, 0, 0, 0, 0, 0, 0, 0, 118, 0,
@ -518,7 +537,8 @@ hb_use_u8[3483] =
0, 128, 20, 27, 31, 0, 0, 145, 146, 2, 2, 30, 2, 30, 2, 2,
2, 2, 2, 2, 0, 14, 37, 0, 147, 2, 2, 13, 37, 0, 30, 2,
2, 2, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 30, 2, 2,
9, 2, 2, 11, 41, 0, 0, 0, 0, 2, 2, 2, 2, 2, 27, 38,
9, 2, 2, 11, 41, 0, 0, 0, 0, 2, 2, 2, 0, 27, 22, 22,
30, 2, 2, 2, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 27, 38,
0, 2, 2, 2, 116, 116, 116, 116, 116, 148, 2, 9, 0, 0, 0, 0,
0, 2, 14, 14, 0, 0, 0, 0, 0, 9, 2, 2, 9, 2, 2, 2,
2, 30, 2, 9, 0, 30, 2, 0, 0, 149, 150, 151, 2, 2, 2, 2,
@ -536,39 +556,45 @@ hb_use_u8[3483] =
10, 18, 19, 21, 22, 162, 31, 0, 0, 11, 11, 30, 2, 2, 2, 9,
30, 9, 2, 30, 2, 2, 58, 17, 23, 16, 23, 47, 32, 33, 32, 34,
0, 0, 0, 0, 35, 0, 0, 0, 2, 2, 23, 0, 11, 11, 11, 46,
0, 11, 11, 46, 0, 0, 0, 0, 0, 2, 2, 65, 25, 20, 20, 20,
22, 23, 126, 15, 17, 0, 0, 0, 0, 2, 2, 2, 2, 2, 0, 0,
163, 164, 0, 0, 0, 0, 0, 0, 0, 18, 19, 20, 20, 66, 99, 25,
160, 11, 165, 9, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 2,
65, 25, 20, 20, 0, 48, 48, 11, 166, 37, 0, 0, 0, 0, 0, 0,
0, 0, 0, 0, 0, 2, 2, 20, 0, 23, 19, 20, 20, 21, 16, 82,
166, 38, 0, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 10, 167,
25, 20, 22, 22, 165, 9, 0, 0, 0, 2, 2, 2, 2, 2, 9, 43,
136, 23, 22, 20, 76, 21, 22, 0, 0, 2, 2, 2, 9, 0, 0, 0,
0, 2, 2, 2, 2, 2, 2, 18, 19, 20, 21, 22, 105, 166, 37, 0,
0, 2, 2, 2, 9, 30, 0, 2, 2, 2, 2, 30, 9, 2, 2, 2,
2, 23, 23, 18, 32, 33, 12, 168, 169, 170, 171, 0, 0, 0, 0, 0,
0, 2, 2, 2, 2, 0, 2, 2, 2, 65, 25, 20, 20, 0, 22, 23,
29, 108, 0, 33, 0, 0, 0, 0, 0, 52, 20, 22, 22, 22, 140, 2,
2, 2, 172, 173, 11, 15, 174, 72, 175, 0, 0, 1, 147, 0, 0, 0,
0, 52, 20, 22, 16, 19, 20, 2, 2, 2, 2, 158, 158, 158, 176, 176,
176, 176, 176, 176, 15, 177, 0, 30, 0, 22, 20, 20, 31, 22, 22, 11,
166, 0, 61, 61, 61, 61, 61, 61, 61, 66, 21, 82, 46, 0, 0, 0,
0, 2, 2, 2, 9, 2, 30, 2, 2, 52, 22, 22, 31, 0, 38, 22,
27, 11, 159, 178, 174, 0, 0, 0, 0, 2, 2, 2, 30, 9, 2, 2,
2, 2, 2, 2, 2, 2, 23, 23, 47, 22, 35, 82, 68, 0, 0, 0,
0, 2, 179, 66, 47, 0, 0, 0, 0, 11, 180, 2, 2, 2, 2, 2,
2, 2, 2, 23, 22, 20, 31, 0, 48, 16, 143, 0, 0, 0, 0, 0,
0, 181, 181, 181, 181, 181, 181, 181, 181, 182, 182, 182, 183, 184, 182, 181,
181, 185, 181, 181, 186, 187, 187, 187, 187, 187, 187, 187, 0, 0, 0, 0,
0, 11, 11, 11, 46, 0, 0, 0, 0, 2, 2, 2, 2, 2, 9, 0,
58, 188, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 0, 0, 0, 40, 116, 26, 0, 0, 0, 0, 0,
0, 0, 0, 9, 0, 0, 0, 0, 0, 2, 2, 2, 0, 0, 0, 0,
0, 2, 2, 2, 2, 2, 0, 58, 37, 0, 6, 120, 120, 120, 121, 0,
0, 11, 11, 11, 49, 2, 2, 2, 0, 2, 2, 2, 2, 2, 0, 0,
2, 2, 2, 2, 2, 2, 2, 2, 46, 2, 2, 2, 2, 2, 2, 11,
11, 2, 2, 2, 2, 2, 2, 22, 22, 2, 2, 44, 44, 44, 92, 0,
0, 11, 11, 46, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 30, 0,
9, 2, 2, 2, 30, 45, 59, 20, 20, 31, 33, 32, 32, 25, 163, 29,
164, 165, 37, 0, 0, 0, 0, 0, 0, 12, 26, 0, 0, 0, 0, 0,
0, 2, 2, 65, 25, 20, 20, 20, 22, 23, 126, 15, 17, 0, 0, 0,
0, 2, 2, 2, 2, 2, 0, 0, 166, 167, 0, 0, 0, 0, 0, 0,
0, 18, 19, 20, 20, 66, 99, 25, 160, 11, 168, 9, 0, 0, 0, 0,
0, 2, 2, 2, 2, 2, 2, 2, 65, 25, 20, 20, 0, 48, 48, 11,
169, 37, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 2, 2, 20,
0, 23, 19, 20, 20, 21, 16, 82, 169, 38, 0, 0, 0, 0, 0, 0,
0, 2, 2, 2, 2, 2, 10, 170, 25, 20, 22, 22, 168, 9, 0, 0,
0, 2, 2, 2, 2, 2, 9, 43, 136, 23, 22, 20, 76, 21, 22, 0,
0, 2, 2, 2, 9, 0, 0, 0, 0, 2, 2, 2, 2, 2, 2, 18,
19, 20, 21, 22, 105, 169, 37, 0, 0, 2, 2, 2, 9, 30, 0, 2,
2, 2, 2, 30, 9, 2, 2, 2, 2, 23, 23, 18, 32, 33, 12, 171,
165, 172, 173, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 0, 2, 2,
2, 65, 25, 20, 20, 0, 22, 23, 29, 108, 0, 33, 0, 0, 0, 0,
0, 52, 20, 22, 22, 22, 140, 2, 2, 2, 174, 175, 11, 15, 176, 61,
177, 0, 0, 1, 147, 0, 0, 0, 0, 52, 20, 22, 16, 19, 20, 2,
2, 2, 2, 158, 158, 158, 178, 178, 178, 178, 178, 178, 15, 179, 0, 30,
0, 22, 20, 20, 31, 22, 22, 11, 169, 0, 61, 61, 61, 61, 61, 61,
61, 66, 21, 82, 46, 0, 0, 0, 0, 2, 2, 2, 9, 2, 30, 2,
2, 52, 22, 22, 31, 0, 38, 22, 27, 11, 159, 180, 181, 0, 0, 0,
0, 2, 2, 2, 30, 9, 2, 2, 2, 2, 2, 2, 2, 2, 23, 23,
47, 22, 35, 82, 68, 0, 0, 0, 0, 2, 182, 66, 47, 0, 0, 0,
0, 11, 183, 2, 2, 2, 2, 2, 2, 2, 2, 23, 22, 20, 31, 0,
48, 16, 143, 0, 0, 0, 0, 0, 0, 2, 2, 2, 2, 2, 156, 0,
0, 184, 184, 184, 184, 184, 184, 184, 184, 185, 185, 185, 186, 187, 185, 184,
184, 188, 184, 184, 189, 190, 190, 190, 190, 190, 190, 190, 0, 0, 0, 0,
0, 184, 184, 184, 184, 184, 191, 0, 0, 2, 2, 2, 2, 2, 2, 2,
22, 22, 22, 22, 22, 22, 192, 193, 194, 11, 11, 11, 46, 0, 0, 0,
0, 29, 74, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 2, 65, 47,
0, 2, 2, 2, 2, 2, 9, 0, 58, 195, 20, 20, 20, 20, 20, 20,
20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 20, 0, 0, 0,
40, 116, 26, 0, 0, 0, 0, 0, 0, 0, 0, 9, 0, 0, 0, 0,
0, 0, 0, 0, 0, 0, 0, 0, 30, 2, 2, 2, 2, 2, 0, 58,
37, 0, 6, 120, 120, 120, 121, 0, 0, 11, 11, 11, 49, 2, 2, 2,
0, 2, 2, 2, 2, 2, 0, 0, 2, 2, 2, 2, 2, 2, 2, 2,
46, 2, 2, 2, 2, 2, 2, 11, 11, 2, 2, 2, 2, 2, 2, 22,
22, 2, 2, 2, 2, 2, 2, 2, 20, 2, 2, 44, 44, 44, 92, 0,
0, O, O, O, GB, B, B, O, SB, O, SE, GB, O, O, WJ,FMPst,
FMPst, O, CGJ, B, O, B,VMAbv,VMAbv,VMAbv, O,VMAbv, B,CMBlw,CMBlw,CMBlw,VMAbv,
VMPst, VAbv, VPst,CMBlw, B, VPst, VPre, VPst, VBlw, VBlw, VBlw, VBlw, VAbv, VAbv, VAbv, VPst,
@ -582,20 +608,21 @@ hb_use_u8[3483] =
VMPst, VBlw, VPst, CGJ, CGJ, VPst,VMAbv,VMAbv,FMAbv, FAbv,CMAbv,FMAbv,VMAbv,FMAbv, VAbv, IS,
FMAbv, B,FMAbv, B, CGJ, WJ, CGJ, GB,CMAbv,CMAbv, B, GB, B, VAbv, SUB, FPst,
FPst,VMBlw, FPst, FPst, FBlw,VMAbv,FMBlw, VAbv, VPre, B, MPre, MBlw, SUB, FAbv, FAbv, MAbv,
SUB, Sk, VPst, VAbv,VMAbv,VMAbv, FAbv,CMAbv, VPst, H, B, O,SMAbv,SMBlw,SMAbv,SMAbv,
SMAbv, VPst, IS, VBlw, FAbv,VMPre,VMPre,FMAbv,CMBlw,VMBlw,VMBlw,VMAbv, CS, O,FMAbv, ZWNJ,
SUB, Sk, VPst, VAbv,VMAbv,VMAbv, FAbv,CMAbv, VPst, H, B, O,SMAbv,SMAbv,SMAbv, VPst,
IS, RK, RK, VBlw, FAbv,VMPre,VMPre,FMAbv,CMBlw,VMBlw,VMBlw,VMAbv, CS, O,FMAbv, ZWNJ,
CGJ, WJ, WJ, WJ, O,FMPst, O, SB, SE, O, H, MPst, VPst, H,VMAbv, VAbv,
VMBlw, B, VBlw, FPst, VPst, FAbv,VMPst, B,CMAbv, VAbv, MBlw, MPst, MBlw, H, O, VBlw,
MPst, MPre, MAbv, MBlw, O, B, FAbv, FAbv, FPst, VBlw, B, B, VPre, O,VMPst, IS,
O,VMPst, VBlw, VPst,VMBlw,VMBlw,VMAbv, O, IS,VMBlw, B,VMPst,VMAbv,VMPst, CS, CS,
B, N, N, O, HN, VPre, VBlw, VAbv, IS,CMAbv, O, VPst, B, R, R,CMBlw,
VAbv, VPre,VMAbv,VMAbv, H, VAbv,CMBlw,FMAbv, B, CS, CS, H,CMBlw,VMPst, H,VMPst,
VAbv,VMAbv, VPst, IS, R, MPst, R, MPst,CMBlw, B,FMBlw, VBlw,VMAbv, R, MBlw, MBlw,
GB, FBlw, FBlw,CMAbv, IS, VBlw, IS, GB, VAbv, R,VMPst, G, G, J, J, J,
SB, SE, J, HR, G, G, HM, HM, HM, O, VBlw,
VAbv, VPre,VMAbv,VMAbv, H, VAbv,CMBlw,VMPst, O,VMAbv,CMBlw, IS, R,FMAbv, B, CS,
CS, H,CMBlw,VMPst, H,VMPst, VAbv,VMAbv, VPst, MPst, R, MPst,CMBlw, B,FMBlw, VBlw,
VMAbv, CS, SUB, SUB, GB, FBlw, FBlw,CMAbv, IS, VBlw, IS, R, MBlw, GB, VAbv, R,
VMPst, G, G, J, J, J, SB, SE, J, HR, G, G, HM, HM, HM, G,
O, MPre, MPre, MPst,VMAbv, MBlw, VBlw, O, VBlw,
};
static const uint16_t
hb_use_u16[456] =
hb_use_u16[486] =
{
0, 0, 1, 2, 0, 3, 4, 5, 0, 6, 7, 0, 8, 0, 9, 10,
11, 12, 10, 13, 14, 10, 10, 15, 16, 17, 18, 19, 20, 21, 22, 23,
@ -614,18 +641,20 @@ hb_use_u16[456] =
148,149,150, 10, 10,151,152, 2,153, 99,154,155,156, 2, 10,157,
10,158,159, 0,160,161,162, 2,163, 0, 0,164, 0,165, 0,166,
166,167, 34,168,169,170, 10,171, 95, 0,172, 0, 10,173,174, 0,
175, 2,176,173,177,178,179, 0, 0,180,181, 0,182, 10, 10,183,
184,185,186,187,188, 10, 10,189,190, 0,191, 10,192,193,194, 10,
10,195, 10,196,197,106,198,103, 10, 34,199,200,201, 0,202,203,
95, 10, 10,204,205, 2,206, 21, 22,207,208,209,210,211, 10,212,
213,214,215, 0,198, 10, 10,216,217, 2,218,219,220,221, 10,222,
223, 2,224,225, 10,226,227,104,228, 0,229,230,231,232, 10,233,
234, 2,235, 10, 10,236,237, 0,238, 10, 10,239,240,241,242,243,
22, 10,218,244, 8, 10, 71, 19, 10,245, 74,246,247, 10, 10,248,
249, 2,250, 10,251,252, 10,253,254, 49, 10,255,256, 2,257,257,
257,258,259,260, 10,261,262,263,264,264,265,266,267, 0, 10,268,
106, 71, 95,269, 0,270, 71,271,272, 0,273, 0,274, 2,275, 2,
276, 2,130,130,163,163,163,130,
175, 2,176, 10,177, 0,178,173,179,180,181, 0, 0,182,183, 0,
184, 10, 10,185,186,187,188,189,190, 10, 10,191,192, 0,193, 10,
194,195,196, 10, 10,197, 10,198,199,106,200,103, 10, 34,201,202,
203, 0,204,205, 95, 10, 10,206,207, 2,208, 21, 22,209,210,211,
212,213,214, 10, 10,215,216,217,218, 0, 10,219,220,221,222, 0,
200, 10, 10,223,224, 2,225,226,227,228, 10,229,230, 2,231,232,
2, 10,141, 0, 10,233,234,104,235, 0,236,237,238,239, 10,240,
241, 2,242, 10, 10,243,244, 0,245, 10, 10,246,247,248,249,250,
22, 10,225,251, 8, 10, 71, 19, 10,252, 74,253,254, 10, 10,255,
256, 2,257, 10,258,259, 10,260,261, 49, 10,262,263,264,265,265,
265,266,267,268,265,269, 10,270,271, 2, 10,272,273, 10,274, 2,
275,276,277,277,278,279,280, 0, 10,177, 0,281,106, 71, 95,282,
0,283, 71,284,285, 0,286, 0,287, 2,288, 2,289,106,290, 2,
130,130,163,163,163,130,
};
static inline unsigned
@ -636,7 +665,7 @@ hb_use_b4 (const uint8_t* a, unsigned i)
static inline uint_fast8_t
hb_use_get_category (unsigned u)
{
return u<921600u?hb_use_u8[3105+(((hb_use_u8[889+(((hb_use_u16[((hb_use_u8[353+(((hb_use_u8[113+(((hb_use_b4(hb_use_u8,u>>1>>3>>1>>3>>4))<<4)+((u>>1>>3>>1>>3)&15u))])<<3)+((u>>1>>3>>1)&7u))])<<1)+((u>>1>>3)&1u)])<<3)+((u>>1)&7u))])<<1)+((u)&1u))]:O;
return u<921600u?hb_use_u8[3265+(((hb_use_u8[937+(((hb_use_u16[((hb_use_u8[369+(((hb_use_u8[113+(((hb_use_b4(hb_use_u8,u>>1>>3>>1>>3>>4))<<4)+((u>>1>>3>>1>>3)&15u))])<<3)+((u>>1>>3>>1)&7u))])<<1)+((u>>1>>3)&1u)])<<3)+((u>>1)&7u))])<<1)+((u)&1u))]:O;
}
#endif
@ -656,6 +685,7 @@ hb_use_get_category (unsigned u)
#undef N
#undef O
#undef R
#undef RK
#undef SB
#undef SE
#undef SUB

View file

@ -10,8 +10,8 @@
* # Date: 2015-03-12, 21:17:00 GMT [AG]
* # Date: 2019-11-08, 23:22:00 GMT [AG]
*
* # Scripts-15.1.0.txt
* # Date: 2023-07-28, 16:01:07 GMT
* # Scripts-16.0.0.txt
* # Date: 2024-04-30, 21:48:40 GMT
*/
#include "hb.hh"

View file

@ -387,6 +387,15 @@ hb_ot_shaper_categorize (hb_script_t script,
case HB_SCRIPT_KAWI:
case HB_SCRIPT_NAG_MUNDARI:
/* Unicode-16.0 additions */
case HB_SCRIPT_GARAY:
case HB_SCRIPT_GURUNG_KHEMA:
case HB_SCRIPT_KIRAT_RAI:
case HB_SCRIPT_OL_ONAL:
case HB_SCRIPT_SUNUWAR:
case HB_SCRIPT_TODHRI:
case HB_SCRIPT_TULU_TIGALARI:
/* If the designer designed the font for the 'DFLT' script,
* (or we ended up arbitrarily pick 'latn'), use the default shaper.
* Otherwise, use the specific shaper.

View file

@ -354,10 +354,10 @@ struct AxisValue
{
switch (u.format)
{
case 1: return u.format1.get_value ();
case 2: return u.format2.get_value ();
case 3: return u.format3.get_value ();
case 4: return u.format4.get_axis_record (axis_index).get_value ();
case 1: hb_barrier (); return u.format1.get_value ();
case 2: hb_barrier (); return u.format2.get_value ();
case 3: hb_barrier (); return u.format3.get_value ();
case 4: hb_barrier (); return u.format4.get_axis_record (axis_index).get_value ();
default:return 0.f;
}
}
@ -366,9 +366,9 @@ struct AxisValue
{
switch (u.format)
{
case 1: return u.format1.get_axis_index ();
case 2: return u.format2.get_axis_index ();
case 3: return u.format3.get_axis_index ();
case 1: hb_barrier (); return u.format1.get_axis_index ();
case 2: hb_barrier (); return u.format2.get_axis_index ();
case 3: hb_barrier (); return u.format3.get_axis_index ();
/* case 4: Makes more sense for variable fonts which are handled by fvar in hb-style */
default:return -1;
}
@ -378,10 +378,10 @@ struct AxisValue
{
switch (u.format)
{
case 1: return u.format1.get_value_name_id ();
case 2: return u.format2.get_value_name_id ();
case 3: return u.format3.get_value_name_id ();
case 4: return u.format4.get_value_name_id ();
case 1: hb_barrier (); return u.format1.get_value_name_id ();
case 2: hb_barrier (); return u.format2.get_value_name_id ();
case 3: hb_barrier (); return u.format3.get_value_name_id ();
case 4: hb_barrier (); return u.format4.get_value_name_id ();
default:return HB_OT_NAME_ID_INVALID;
}
}
@ -392,10 +392,10 @@ struct AxisValue
if (unlikely (!c->may_dispatch (this, &u.format))) return c->no_dispatch_return_value ();
TRACE_DISPATCH (this, u.format);
switch (u.format) {
case 1: return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 4: return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
case 1: hb_barrier (); return_trace (c->dispatch (u.format1, std::forward<Ts> (ds)...));
case 2: hb_barrier (); return_trace (c->dispatch (u.format2, std::forward<Ts> (ds)...));
case 3: hb_barrier (); return_trace (c->dispatch (u.format3, std::forward<Ts> (ds)...));
case 4: hb_barrier (); return_trace (c->dispatch (u.format4, std::forward<Ts> (ds)...));
default:return_trace (c->default_return_value ());
}
}
@ -405,10 +405,10 @@ struct AxisValue
{
switch (u.format)
{
case 1: return u.format1.keep_axis_value (axis_records, user_axes_location);
case 2: return u.format2.keep_axis_value (axis_records, user_axes_location);
case 3: return u.format3.keep_axis_value (axis_records, user_axes_location);
case 4: return u.format4.keep_axis_value (axis_records, user_axes_location);
case 1: hb_barrier (); return u.format1.keep_axis_value (axis_records, user_axes_location);
case 2: hb_barrier (); return u.format2.keep_axis_value (axis_records, user_axes_location);
case 3: hb_barrier (); return u.format3.keep_axis_value (axis_records, user_axes_location);
case 4: hb_barrier (); return u.format4.keep_axis_value (axis_records, user_axes_location);
default:return false;
}
}
@ -422,10 +422,10 @@ struct AxisValue
switch (u.format)
{
case 1: return_trace (u.format1.sanitize (c));
case 2: return_trace (u.format2.sanitize (c));
case 3: return_trace (u.format3.sanitize (c));
case 4: return_trace (u.format4.sanitize (c));
case 1: hb_barrier (); return_trace (u.format1.sanitize (c));
case 2: hb_barrier (); return_trace (u.format2.sanitize (c));
case 3: hb_barrier (); return_trace (u.format3.sanitize (c));
case 4: hb_barrier (); return_trace (u.format4.sanitize (c));
default:return_trace (true);
}
}

View file

@ -6,8 +6,8 @@
*
* on files with these headers:
*
* <meta name="updated_at" content="2024-05-31 05:41 PM" />
* File-Date: 2024-05-16
* <meta name="updated_at" content="2024-07-07 12:57 AM" />
* File-Date: 2024-06-14
*/
#ifndef HB_OT_TAG_TABLE_HH

View file

@ -238,8 +238,8 @@ struct tuple_delta_t
/* compiled data: header and deltas
* compiled point data is saved in a hashmap within tuple_variations_t cause
* some point sets might be reused by different tuple variations */
hb_vector_t<char> compiled_tuple_header;
hb_vector_t<char> compiled_deltas;
hb_vector_t<unsigned char> compiled_tuple_header;
hb_vector_t<unsigned char> compiled_deltas;
/* compiled peak coords, empty for non-gvar tuples */
hb_vector_t<char> compiled_peak_coords;
@ -517,7 +517,7 @@ struct tuple_delta_t
static bool compile_deltas (const hb_vector_t<bool> &point_indices,
const hb_vector_t<double> &x_deltas,
const hb_vector_t<double> &y_deltas,
hb_vector_t<char> &compiled_deltas /* OUT */)
hb_vector_t<unsigned char> &compiled_deltas /* OUT */)
{
hb_vector_t<int> rounded_deltas;
if (unlikely (!rounded_deltas.alloc (point_indices.length)))
@ -560,7 +560,7 @@ struct tuple_delta_t
return compiled_deltas.resize (encoded_len);
}
static unsigned compile_deltas (hb_array_t<char> encoded_bytes,
static unsigned compile_deltas (hb_array_t<unsigned char> encoded_bytes,
hb_array_t<const int> deltas)
{
return TupleValues::compile (deltas, encoded_bytes);
@ -705,20 +705,20 @@ struct tuple_delta_t
opt_indices.arrayZ[i] = false;
}
hb_vector_t<char> opt_point_data;
hb_vector_t<unsigned char> opt_point_data;
if (!compile_point_set (opt_indices, opt_point_data))
return false;
hb_vector_t<char> opt_deltas_data;
hb_vector_t<unsigned char> opt_deltas_data;
if (!compile_deltas (opt_indices,
is_comp_glyph_wo_deltas ? opt_deltas_x : deltas_x,
is_comp_glyph_wo_deltas ? opt_deltas_y : deltas_y,
opt_deltas_data))
return false;
hb_vector_t<char> point_data;
hb_vector_t<unsigned char> point_data;
if (!compile_point_set (indices, point_data))
return false;
hb_vector_t<char> deltas_data;
hb_vector_t<unsigned char> deltas_data;
if (!compile_deltas (indices, deltas_x, deltas_y, deltas_data))
return false;
@ -740,7 +740,7 @@ struct tuple_delta_t
}
static bool compile_point_set (const hb_vector_t<bool> &point_indices,
hb_vector_t<char>& compiled_points /* OUT */)
hb_vector_t<unsigned char>& compiled_points /* OUT */)
{
unsigned num_points = 0;
for (bool i : point_indices)
@ -1134,7 +1134,7 @@ struct TupleVariationData
continue;
}
hb_vector_t<char> compiled_point_data;
hb_vector_t<unsigned char> compiled_point_data;
if (!tuple_delta_t::compile_point_set (*points_set, compiled_point_data))
return false;
@ -1663,7 +1663,9 @@ struct item_variations_t
}
}
if (!all_regions || !all_unique_regions) return false;
/* regions are empty means no variation data, return true */
if (!all_regions || !all_unique_regions) return true;
if (!region_list.alloc (all_regions.get_population ()))
return false;
@ -1728,7 +1730,8 @@ struct item_variations_t
bool as_item_varstore (bool optimize=true, bool use_no_variation_idx=true)
{
if (!region_list) return false;
/* return true if no variation data */
if (!region_list) return true;
unsigned num_cols = region_list.length;
/* pre-alloc a 2D vector for all sub_table's VarData rows */
unsigned total_rows = 0;

View file

@ -359,7 +359,10 @@ struct gvar
out->glyphCountX = hb_min (0xFFFFu, num_glyphs);
unsigned glyph_var_data_size = glyph_vars.compiled_byte_size ();
bool long_offset = glyph_var_data_size & ~0xFFFFu || force_long_offsets;
/* According to the spec: If the short format (Offset16) is used for offsets,
* the value stored is the offset divided by 2, so the maximum data size should
* be 2 * 0xFFFFu, which is 0x1FFFEu */
bool long_offset = glyph_var_data_size > 0x1FFFEu || force_long_offsets;
out->flags = long_offset ? 1 : 0;
HBUINT8 *glyph_var_data_offsets = c->allocate_size<HBUINT8> ((long_offset ? 4 : 2) * (num_glyphs + 1), false);
@ -440,7 +443,10 @@ struct gvar
subset_data_size += get_glyph_var_data_bytes (c->source_blob, glyph_count, old_gid).length;
}
bool long_offset = (subset_data_size & ~0xFFFFu);
/* According to the spec: If the short format (Offset16) is used for offsets,
* the value stored is the offset divided by 2, so the maximum data size should
* be 2 * 0xFFFFu, which is 0x1FFFEu */
bool long_offset = subset_data_size > 0x1FFFEu;
#ifdef HB_EXPERIMENTAL_API
long_offset = long_offset || (c->plan->flags & HB_SUBSET_FLAGS_IFTB_REQUIREMENTS);
#endif
@ -540,7 +546,7 @@ struct gvar
unsigned get_offset (unsigned glyph_count, unsigned i) const
{
if (unlikely (i > glyph_count)) return 0;
_hb_compiler_memory_r_barrier ();
hb_barrier ();
return is_long_offset () ? get_long_offset_array ()[i] : get_short_offset_array ()[i] * 2;
}

View file

@ -70,7 +70,10 @@ struct hb_paint_extents_context_t
const hb_transform_t &t = transforms.tail ();
t.transform_extents (extents);
clips.push (hb_bounds_t {extents});
auto bounds = hb_bounds_t {extents};
bounds.intersect (clips.tail ());
clips.push (bounds);
}
void pop_clip ()

View file

@ -61,8 +61,8 @@ _hb_ratio_to_angle (float r)
* @style_tag: a style tag.
*
* Searches variation axes of a #hb_font_t object for a specific axis first,
* if not set, then tries to get default style values from different
* tables of the font.
* if not set, first tries to get default style values in `STAT` table
* then tries to polyfill from different tables of the font.
*
* Returns: Corresponding axis or default value to a style tag.
*

View file

@ -666,9 +666,6 @@ OT::cff2::accelerator_subset_t::serialize (hb_serialize_context_t *c,
bool
OT::cff2::accelerator_subset_t::subset (hb_subset_context_t *c) const
{
if (c->plan->normalized_coords && !c->plan->all_axes_pinned)
fprintf (stdout, "warning: CFF partial instancing is not supported.\n");
cff2_subset_plan cff2_plan;
if (unlikely (!cff2_plan.create (*this, c->plan))) return false;

View file

@ -376,7 +376,7 @@ double renormalizeValue (double v, const Triple &triple,
assert (lower <= def && def <= upper);
if (!extrapolate)
v = hb_max (hb_min (v, upper), lower);
v = hb_clamp (v, lower, upper);
if (v == def)
return 0.0;

View file

@ -594,14 +594,20 @@ static void _attach_accelerator_data (hb_subset_plan_t* plan,
* @input: input to use for the subsetting.
*
* Subsets a font according to provided input. Returns nullptr
* if the subset operation fails.
* if the subset operation fails or the face has no glyphs.
*
* Since: 2.9.0
**/
hb_face_t *
hb_subset_or_fail (hb_face_t *source, const hb_subset_input_t *input)
{
if (unlikely (!input || !source)) return hb_face_get_empty ();
if (unlikely (!input || !source)) return nullptr;
if (unlikely (!source->get_num_glyphs ()))
{
DEBUG_MSG (SUBSET, nullptr, "No glyphs in source font.");
return nullptr;
}
hb_subset_plan_t *plan = hb_subset_plan_create_or_fail (source, input);
if (unlikely (!plan)) {

File diff suppressed because it is too large Load diff

View file

@ -7,13 +7,13 @@
* on file with this header:
*
* # emoji-data.txt
* # Date: 2023-02-01, 02:22:54 GMT
* # © 2023 Unicode®, Inc.
* # Date: 2024-05-01, 21:25:24 GMT
* # © 2024 Unicode®, Inc.
* # Unicode and the Unicode Logo are registered trademarks of Unicode, Inc. in the U.S. and other countries.
* # For terms of use, see https://www.unicode.org/terms_of_use.html
* # For terms of use and license, see https://www.unicode.org/terms_of_use.html
* #
* # Emoji Data for UTS #51
* # Used with Emoji Version 15.1 and subsequent minor revisions (if any)
* # Used with Emoji Version 16.0 and subsequent minor revisions (if any)
* #
* # For documentation and usage, see https://www.unicode.org/reports/tr51
*/

View file

@ -41,13 +41,13 @@ HB_BEGIN_DECLS
*
* The major component of the library version available at compile-time.
*/
#define HB_VERSION_MAJOR 9
#define HB_VERSION_MAJOR 10
/**
* HB_VERSION_MINOR:
*
* The minor component of the library version available at compile-time.
*/
#define HB_VERSION_MINOR 0
#define HB_VERSION_MINOR 1
/**
* HB_VERSION_MICRO:
*
@ -60,7 +60,7 @@ HB_BEGIN_DECLS
*
* A string literal containing the library version available at compile-time.
*/
#define HB_VERSION_STRING "9.0.0"
#define HB_VERSION_STRING "10.1.0"
/**
* HB_VERSION_ATLEAST:

View file

@ -84,6 +84,7 @@
#pragma GCC diagnostic error "-Wredundant-decls"
#pragma GCC diagnostic error "-Wreorder"
#pragma GCC diagnostic error "-Wsign-compare"
#pragma GCC diagnostic error "-Wstrict-flex-arrays"
#pragma GCC diagnostic error "-Wstrict-prototypes"
#pragma GCC diagnostic error "-Wstring-conversion"
#pragma GCC diagnostic error "-Wswitch-enum"