[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[freetype2-demos] master d01c79a: Synchronize with FreeType.
From: |
Werner Lemberg |
Subject: |
[freetype2-demos] master d01c79a: Synchronize with FreeType. |
Date: |
Sat, 2 Oct 2021 23:01:00 -0400 (EDT) |
branch: master
commit d01c79af98381369ffacbf52c47bd8815cc5abfd
Author: Alexei Podtelezhnikov <apodtele@gmail.com>
Commit: Alexei Podtelezhnikov <apodtele@gmail.com>
Synchronize with FreeType.
* src/ftcommon.c (FTDemo_Hinting_Engine_Change, FTDemo_Get_Info):
Use new public `FT_FACE_DRIVER_NAME` macro.
* src/ftdump.c (Print_Type): Ditto.
* src/ftdiff.c (process_event, render_state_draw): Ditto.
* src/ftinspect/engine/engine.cpp (loadFont): Ditto.
---
src/ftcommon.c | 4 ++--
src/ftdiff.c | 26 ++++++++++++--------------
src/ftdump.c | 7 +------
src/ftinspect/engine/engine.cpp | 6 +-----
4 files changed, 16 insertions(+), 27 deletions(-)
diff --git a/src/ftcommon.c b/src/ftcommon.c
index 3837f73..36eeefe 100644
--- a/src/ftcommon.c
+++ b/src/ftcommon.c
@@ -927,7 +927,7 @@
handle->lcd_mode == LCD_MODE_LIGHT_SUBPIXEL )
return 0; /* do nothing */
- module_name = (*(FT_Module_Class**)(face->driver))->module_name;
+ module_name = FT_FACE_DRIVER_NAME( face );
if ( !handle->autohint &&
!FT_Property_Get( library, module_name,
@@ -1002,7 +1002,7 @@
error = FTC_Manager_LookupFace( handle->cache_manager,
handle->scaler.face_id, &face );
- module_name = (*(FT_Module_Class**)(face->driver))->module_name;
+ module_name = FT_FACE_DRIVER_NAME( face );
if ( !FT_IS_SCALABLE( face ) )
hinting_engine = " bitmap";
diff --git a/src/ftdiff.c b/src/ftdiff.c
index 10443d7..27431aa 100644
--- a/src/ftdiff.c
+++ b/src/ftdiff.c
@@ -21,10 +21,8 @@
#include FT_LCD_FILTER_H
#include FT_DRIVER_H
- /* showing driver name -- the internal header file */
- /* shouldn't be used in normal programs */
+ /* showing driver name */
#include FT_MODULE_H
-#include <freetype/internal/ftobjs.h>
#include <stdarg.h>
#include <stdio.h>
@@ -791,8 +789,8 @@
/* display footer on this column */
{
- FT_Module module = &state->face->driver->root;
- void* disp = state->display.disp;
+ const char* module_name = FT_FACE_DRIVER_NAME( state->face );
+ void* disp = state->display.disp;
const char* extra;
const char* msg;
@@ -802,7 +800,7 @@
extra = "";
if ( rmode == HINT_MODE_BYTECODE )
{
- if ( !strcmp( module->clazz->module_name, "cff" ) )
+ if ( !strcmp( module_name, "cff" ) )
{
switch ( column->cff_hinting_engine )
{
@@ -815,7 +813,7 @@
}
}
- else if ( !strcmp( module->clazz->module_name, "type1" ) )
+ else if ( !strcmp( module_name, "type1" ) )
{
switch ( column->type1_hinting_engine )
{
@@ -828,7 +826,7 @@
}
}
- else if ( !strcmp( module->clazz->module_name, "t1cid" ) )
+ else if ( !strcmp( module_name, "t1cid" ) )
{
switch ( column->t1cid_hinting_engine )
{
@@ -841,7 +839,7 @@
}
}
- else if ( !strcmp( module->clazz->module_name, "truetype" ) )
+ else if ( !strcmp( module_name, "truetype" ) )
{
switch ( column->tt_interpreter_versions[
column->tt_interpreter_version_idx] )
@@ -1273,33 +1271,33 @@
case grKEY( 'H' ):
{
- FT_Module module = &state->face->driver->root;
+ const char* module_name = FT_FACE_DRIVER_NAME( state->face );
if ( column->hint_mode == HINT_MODE_BYTECODE )
{
- if ( !strcmp( module->clazz->module_name, "cff" ) )
+ if ( !strcmp( module_name, "cff" ) )
{
FTDemo_Event_Cff_Hinting_Engine_Change(
state->library,
&column->cff_hinting_engine,
1 );
}
- else if ( !strcmp( module->clazz->module_name, "type1" ) )
+ else if ( !strcmp( module_name, "type1" ) )
{
FTDemo_Event_Type1_Hinting_Engine_Change(
state->library,
&column->type1_hinting_engine,
1 );
}
- else if ( !strcmp( module->clazz->module_name, "t1cid" ) )
+ else if ( !strcmp( module_name, "t1cid" ) )
{
FTDemo_Event_T1cid_Hinting_Engine_Change(
state->library,
&column->t1cid_hinting_engine,
1 );
}
- else if ( !strcmp( module->clazz->module_name, "truetype" ) )
+ else if ( !strcmp( module_name, "truetype" ) )
{
column->tt_interpreter_version_idx += 1;
column->tt_interpreter_version_idx %=
diff --git a/src/ftdump.c b/src/ftdump.c
index c7bab79..1e7a769 100644
--- a/src/ftdump.c
+++ b/src/ftdump.c
@@ -20,7 +20,6 @@
/* showing driver name */
#include FT_MODULE_H
-#include <freetype/internal/ftobjs.h>
/* error messages */
#undef FTERRORS_H_
@@ -181,14 +180,10 @@
static void
Print_Type( FT_Face face )
{
- FT_Module module;
-
-
printf( "font type entries\n" );
- module = &face->driver->root;
printf( "%s%s\n", Name_Field( "FreeType driver" ),
- module->clazz->module_name );
+ FT_FACE_DRIVER_NAME( face ) );
/* Is it better to dump all sfnt tag names? */
printf( "%s%s\n", Name_Field( "sfnt wrapped" ),
diff --git a/src/ftinspect/engine/engine.cpp b/src/ftinspect/engine/engine.cpp
index fb1390c..9020e02 100644
--- a/src/ftinspect/engine/engine.cpp
+++ b/src/ftinspect/engine/engine.cpp
@@ -12,9 +12,6 @@
#include FT_DRIVER_H
#include FT_LCD_FILTER_H
-// internal FreeType header files; only available in the source code bundle
-#include <freetype/internal/ftobjs.h>
-
/////////////////////////////////////////////////////////////////////////////
//
@@ -384,8 +381,7 @@ Engine::loadFont(int fontIndex,
curFamilyName = QString(ftSize->face->family_name);
curStyleName = QString(ftSize->face->style_name);
- FT_Module module = &ftSize->face->driver->root;
- const char* moduleName = module->clazz->module_name;
+ const char* moduleName = FT_FACE_DRIVER_NAME( ftSize->face );
// XXX cover all available modules
if (!strcmp(moduleName, "cff"))
[Prev in Thread] |
Current Thread |
[Next in Thread] |
- [freetype2-demos] master d01c79a: Synchronize with FreeType.,
Werner Lemberg <=