Alexei Podtelezhnikov pushed to branch master at FreeType / FreeType Demo Programs
Commits:
-
d01c79af
by Alexei Podtelezhnikov at 2021-10-02T22:50:05-04:00
4 changed files:
Changes:
... | ... | @@ -927,7 +927,7 @@ |
927 | 927 |
handle->lcd_mode == LCD_MODE_LIGHT_SUBPIXEL )
|
928 | 928 |
return 0; /* do nothing */
|
929 | 929 |
|
930 |
- module_name = (*(FT_Module_Class**)(face->driver))->module_name;
|
|
930 |
+ module_name = FT_FACE_DRIVER_NAME( face );
|
|
931 | 931 |
|
932 | 932 |
if ( !handle->autohint &&
|
933 | 933 |
!FT_Property_Get( library, module_name,
|
... | ... | @@ -1002,7 +1002,7 @@ |
1002 | 1002 |
error = FTC_Manager_LookupFace( handle->cache_manager,
|
1003 | 1003 |
handle->scaler.face_id, &face );
|
1004 | 1004 |
|
1005 |
- module_name = (*(FT_Module_Class**)(face->driver))->module_name;
|
|
1005 |
+ module_name = FT_FACE_DRIVER_NAME( face );
|
|
1006 | 1006 |
|
1007 | 1007 |
if ( !FT_IS_SCALABLE( face ) )
|
1008 | 1008 |
hinting_engine = " bitmap";
|
... | ... | @@ -21,10 +21,8 @@ |
21 | 21 |
#include FT_LCD_FILTER_H
|
22 | 22 |
#include FT_DRIVER_H
|
23 | 23 |
|
24 |
- /* showing driver name -- the internal header file */
|
|
25 |
- /* shouldn't be used in normal programs */
|
|
24 |
+ /* showing driver name */
|
|
26 | 25 |
#include FT_MODULE_H
|
27 |
-#include <freetype/internal/ftobjs.h>
|
|
28 | 26 |
|
29 | 27 |
#include <stdarg.h>
|
30 | 28 |
#include <stdio.h>
|
... | ... | @@ -791,8 +789,8 @@ |
791 | 789 |
|
792 | 790 |
/* display footer on this column */
|
793 | 791 |
{
|
794 |
- FT_Module module = &state->face->driver->root;
|
|
795 |
- void* disp = state->display.disp;
|
|
792 |
+ const char* module_name = FT_FACE_DRIVER_NAME( state->face );
|
|
793 |
+ void* disp = state->display.disp;
|
|
796 | 794 |
|
797 | 795 |
const char* extra;
|
798 | 796 |
const char* msg;
|
... | ... | @@ -802,7 +800,7 @@ |
802 | 800 |
extra = "";
|
803 | 801 |
if ( rmode == HINT_MODE_BYTECODE )
|
804 | 802 |
{
|
805 |
- if ( !strcmp( module->clazz->module_name, "cff" ) )
|
|
803 |
+ if ( !strcmp( module_name, "cff" ) )
|
|
806 | 804 |
{
|
807 | 805 |
switch ( column->cff_hinting_engine )
|
808 | 806 |
{
|
... | ... | @@ -815,7 +813,7 @@ |
815 | 813 |
}
|
816 | 814 |
}
|
817 | 815 |
|
818 |
- else if ( !strcmp( module->clazz->module_name, "type1" ) )
|
|
816 |
+ else if ( !strcmp( module_name, "type1" ) )
|
|
819 | 817 |
{
|
820 | 818 |
switch ( column->type1_hinting_engine )
|
821 | 819 |
{
|
... | ... | @@ -828,7 +826,7 @@ |
828 | 826 |
}
|
829 | 827 |
}
|
830 | 828 |
|
831 |
- else if ( !strcmp( module->clazz->module_name, "t1cid" ) )
|
|
829 |
+ else if ( !strcmp( module_name, "t1cid" ) )
|
|
832 | 830 |
{
|
833 | 831 |
switch ( column->t1cid_hinting_engine )
|
834 | 832 |
{
|
... | ... | @@ -841,7 +839,7 @@ |
841 | 839 |
}
|
842 | 840 |
}
|
843 | 841 |
|
844 |
- else if ( !strcmp( module->clazz->module_name, "truetype" ) )
|
|
842 |
+ else if ( !strcmp( module_name, "truetype" ) )
|
|
845 | 843 |
{
|
846 | 844 |
switch ( column->tt_interpreter_versions[
|
847 | 845 |
column->tt_interpreter_version_idx] )
|
... | ... | @@ -1273,33 +1271,33 @@ |
1273 | 1271 |
|
1274 | 1272 |
case grKEY( 'H' ):
|
1275 | 1273 |
{
|
1276 |
- FT_Module module = &state->face->driver->root;
|
|
1274 |
+ const char* module_name = FT_FACE_DRIVER_NAME( state->face );
|
|
1277 | 1275 |
|
1278 | 1276 |
|
1279 | 1277 |
if ( column->hint_mode == HINT_MODE_BYTECODE )
|
1280 | 1278 |
{
|
1281 |
- if ( !strcmp( module->clazz->module_name, "cff" ) )
|
|
1279 |
+ if ( !strcmp( module_name, "cff" ) )
|
|
1282 | 1280 |
{
|
1283 | 1281 |
FTDemo_Event_Cff_Hinting_Engine_Change(
|
1284 | 1282 |
state->library,
|
1285 | 1283 |
&column->cff_hinting_engine,
|
1286 | 1284 |
1 );
|
1287 | 1285 |
}
|
1288 |
- else if ( !strcmp( module->clazz->module_name, "type1" ) )
|
|
1286 |
+ else if ( !strcmp( module_name, "type1" ) )
|
|
1289 | 1287 |
{
|
1290 | 1288 |
FTDemo_Event_Type1_Hinting_Engine_Change(
|
1291 | 1289 |
state->library,
|
1292 | 1290 |
&column->type1_hinting_engine,
|
1293 | 1291 |
1 );
|
1294 | 1292 |
}
|
1295 |
- else if ( !strcmp( module->clazz->module_name, "t1cid" ) )
|
|
1293 |
+ else if ( !strcmp( module_name, "t1cid" ) )
|
|
1296 | 1294 |
{
|
1297 | 1295 |
FTDemo_Event_T1cid_Hinting_Engine_Change(
|
1298 | 1296 |
state->library,
|
1299 | 1297 |
&column->t1cid_hinting_engine,
|
1300 | 1298 |
1 );
|
1301 | 1299 |
}
|
1302 |
- else if ( !strcmp( module->clazz->module_name, "truetype" ) )
|
|
1300 |
+ else if ( !strcmp( module_name, "truetype" ) )
|
|
1303 | 1301 |
{
|
1304 | 1302 |
column->tt_interpreter_version_idx += 1;
|
1305 | 1303 |
column->tt_interpreter_version_idx %=
|
... | ... | @@ -20,7 +20,6 @@ |
20 | 20 |
|
21 | 21 |
/* showing driver name */
|
22 | 22 |
#include FT_MODULE_H
|
23 |
-#include <freetype/internal/ftobjs.h>
|
|
24 | 23 |
|
25 | 24 |
/* error messages */
|
26 | 25 |
#undef FTERRORS_H_
|
... | ... | @@ -181,14 +180,10 @@ |
181 | 180 |
static void
|
182 | 181 |
Print_Type( FT_Face face )
|
183 | 182 |
{
|
184 |
- FT_Module module;
|
|
185 |
- |
|
186 |
- |
|
187 | 183 |
printf( "font type entries\n" );
|
188 | 184 |
|
189 |
- module = &face->driver->root;
|
|
190 | 185 |
printf( "%s%s\n", Name_Field( "FreeType driver" ),
|
191 |
- module->clazz->module_name );
|
|
186 |
+ FT_FACE_DRIVER_NAME( face ) );
|
|
192 | 187 |
|
193 | 188 |
/* Is it better to dump all sfnt tag names? */
|
194 | 189 |
printf( "%s%s\n", Name_Field( "sfnt wrapped" ),
|
... | ... | @@ -12,9 +12,6 @@ |
12 | 12 |
#include FT_DRIVER_H
|
13 | 13 |
#include FT_LCD_FILTER_H
|
14 | 14 |
|
15 |
-// internal FreeType header files; only available in the source code bundle
|
|
16 |
-#include <freetype/internal/ftobjs.h>
|
|
17 |
- |
|
18 | 15 |
|
19 | 16 |
/////////////////////////////////////////////////////////////////////////////
|
20 | 17 |
//
|
... | ... | @@ -384,8 +381,7 @@ Engine::loadFont(int fontIndex, |
384 | 381 |
curFamilyName = QString(ftSize->face->family_name);
|
385 | 382 |
curStyleName = QString(ftSize->face->style_name);
|
386 | 383 |
|
387 |
- FT_Module module = &ftSize->face->driver->root;
|
|
388 |
- const char* moduleName = module->clazz->module_name;
|
|
384 |
+ const char* moduleName = FT_FACE_DRIVER_NAME( ftSize->face );
|
|
389 | 385 |
|
390 | 386 |
// XXX cover all available modules
|
391 | 387 |
if (!strcmp(moduleName, "cff"))
|