Commit bf6d25dd authored by Werner Lemberg's avatar Werner Lemberg
Browse files

Remove code related to warping.

This synchronizes the demo programs with commit 2f11522a from the
FreeType repository.

* src/ftcommon.c (FTDemo_Hinting_Engine_Change, FTDemo_Get_Info):
Updated.

* src/ftdiff.c (ColumnStateRec, render_state_init,
render_state_draw, event_help, process_event): Updated.

* src/ftgrid.c (event_help): Updated.

* src/ftinspect/engine/engine.cpp (Engine::Engine, Engine::update),
src/ftinspect/engine/engine.hpp (Engine): Updated.
* src/ftinspect/maingui.cpp (MainGUI::checkHinting,
MainGUI::checkAutoHinting, MainGUI::createLayout),
src/ftinspect/maingui.hpp (MainGUI): Updated.
parent 24a7dcbb
2021-07-17 Werner Lemberg <wl@gnu.org>
Remove code related to warping.
This synchronizes the demo programs with commit 2f11522a from the
FreeType repository.
* src/ftcommon.c (FTDemo_Hinting_Engine_Change, FTDemo_Get_Info):
Updated.
* src/ftdiff.c (ColumnStateRec, render_state_init,
render_state_draw, event_help, process_event): Updated.
* src/ftgrid.c (event_help): Updated.
* src/ftinspect/engine/engine.cpp (Engine::Engine, Engine::update),
src/ftinspect/engine/engine.hpp (Engine): Updated.
* src/ftinspect/maingui.cpp (MainGUI::checkHinting,
MainGUI::checkAutoHinting, MainGUI::createLayout),
src/ftinspect/maingui.hpp (MainGUI): Updated.
2021-07-01 Werner Lemberg <wl@gnu.org>
* src/ftlint.c (main): Minor output improvement.
......
......@@ -907,7 +907,7 @@
}
/* switch to a different engine if possible, including warping */
/* switch to a different engine if possible */
int
FTDemo_Hinting_Engine_Change( FTDemo_Handle* handle )
{
......@@ -929,18 +929,9 @@
module_name = (*(FT_Module_Class**)(face->driver))->module_name;
if ( handle->autohint )
{
FT_Bool warp;
FT_Property_Get( library, "autofitter", "warping", &warp );
warp = !warp;
FT_Property_Set( library, "autofitter", "warping", &warp );
}
else if ( !FT_Property_Get( library, module_name,
"interpreter-version", &prop ) )
if ( !handle->autohint &&
!FT_Property_Get( library, module_name,
"interpreter-version", &prop ) )
{
switch ( prop )
{
......@@ -1024,10 +1015,7 @@
hinting_engine = " auto";
else if ( handle->autohint )
{
FT_Property_Get( library, "autofitter", "warping", &prop );
hinting_engine = prop ? " warp" : " auto";
}
hinting_engine = " auto";
else if ( !FT_Property_Get( library, module_name,
"interpreter-version", &prop ) )
......
......@@ -293,7 +293,7 @@
FT_Size* asize );
/* switch to a different engine if possible, including warping */
/* switch to a different engine if possible */
int
FTDemo_Hinting_Engine_Change( FTDemo_Handle* handle );
......
......@@ -188,7 +188,6 @@
unsigned int tt_interpreter_versions[3];
int num_tt_interpreter_versions;
int tt_interpreter_version_idx;
FT_Bool warping;
} ColumnStateRec, *ColumnState;
......@@ -233,7 +232,6 @@
FT_UInt cff_hinting_engine;
FT_UInt type1_hinting_engine;
FT_UInt t1cid_hinting_engine;
FT_Bool warping;
unsigned int tt_interpreter_versions[3] = { 0, 0, 0 };
int num_tt_interpreter_versions = 0;
......@@ -287,10 +285,6 @@
"truetype",
"interpreter-version", &dflt_tt_interpreter_version );
FT_Property_Get( library,
"autofitter",
"warping", &warping );
state->columns[0].use_cboxes = 0;
state->columns[0].use_kerning = 1;
state->columns[0].use_deltas = 1;
......@@ -312,7 +306,6 @@
state->columns[0].tt_interpreter_version_idx =
tt_interpreter_version_idx;
state->columns[0].warping = warping;
state->columns[0].use_custom_lcd_filter = 0;
state->columns[0].fw_index = 2;
/* FreeType default filter weights */
......@@ -572,7 +565,6 @@
FT_Pos prev_rsb_delta = 0;
FT_Pos x_origin = x << 6;
HintMode rmode = column->hint_mode;
FT_Bool warping = column->warping;
FT_Bool have_0x0A = 0;
FT_Bool have_0x0D = 0;
......@@ -596,10 +588,6 @@
"interpreter-version",
&column->tt_interpreter_versions
[column->tt_interpreter_version_idx] );
FT_Property_Set( state->library,
"autofitter",
"warping",
&column->warping );
/* changing a property is in most cases a global operation; */
/* we are on the safe side if we reload the face completely */
......@@ -870,8 +858,6 @@
}
}
}
else if ( rmode == HINT_MODE_AUTOHINT )
extra = warping ? " (+warp)" : " (-warp)";
snprintf( temp, sizeof ( temp ), "%s%s",
render_mode_names[column->hint_mode], extra );
......@@ -1145,11 +1131,9 @@
grWriteln( " h cycle hinting mode A unhinted " );
grWriteln( " H cycle hinting engine B auto-hinter " );
grWriteln( " (if CFF or TTF) C light auto-hinter " );
grWriteln( " w toggle warping (if D light auto-hinter " );
grWriteln( " normal auto-hinting) (subpixel) " );
grWriteln( " k toggle kerning (only E native hinter " );
grWriteln( " from `kern' table) " );
grWriteln( " r toggle rendering mode " );
grWriteln( " k toggle kerning (only D light auto-hinter " );
grWriteln( " from `kern' table) (subpixel) " );
grWriteln( " r toggle rendering mode E native hinter " );
grWriteln( " x toggle layout mode " );
grWriteln( " " );
grWriteln( " l cycle LCD filtering " );
......@@ -1331,20 +1315,6 @@
}
break;
case grKEY( 'w' ):
{
FT_Bool new_warping_state = !column->warping;
error = FT_Property_Set( state->library,
"autofitter",
"warping",
&new_warping_state );
if ( !error )
column->warping = new_warping_state;
}
break;
case grKEY( 'k' ):
column->use_kerning = !column->use_kerning;
break;
......
......@@ -850,22 +850,22 @@
grWriteln( "Up, Down adjust size by 0.5pt if not auto-hinting: " );
grWriteln( " H cycle through hinting " );
grWriteln( "Left, Right adjust index by 1 engines (if available) " );
grWriteln( "F7, F8 adjust index by 16 if normal auto-hinting: " );
grWriteln( "F9, F10 adjust index by 256 w toggle warping " );
grWriteln( "F11, F12 adjust index by 4096 (if available) " );
grWriteln( " " );
grWriteln( "h toggle hinting b toggle bitmap " );
grWriteln( "f toggle forced auto- d toggle dot display " );
grWriteln( " hinting (if hinting) o toggle outline display " );
grWriteln( "G toggle grid display D toggle dotnumber display" );
grWriteln( "C change color palette " );
grWriteln( " if Multiple Master or GX font: " );
grWriteln( "F5, F6 cycle through F2 cycle through axes " );
grWriteln( " anti-aliasing modes F3, F4 adjust current axis by " );
grWriteln( "L cycle through LCD 1/50th of its range " );
grWriteln( " filters " );
grWriteln( " P print PNG file " );
grWriteln( "g, v adjust gamma value q, ESC quit ftgrid " );
grWriteln( "F7, F8 adjust index by 16 " );
grWriteln( "F9, F10 adjust index by 256 b toggle bitmap " );
grWriteln( "F11, F12 adjust index by 4096 d toggle dot display " );
grWriteln( " o toggle outline display " );
grWriteln( "h toggle hinting D toggle dotnumber display" );
grWriteln( "f toggle forced auto- " );
grWriteln( " hinting (if hinting) if Multiple Master or GX font: " );
grWriteln( "G toggle grid display F2 cycle through axes " );
grWriteln( "C change color palette F3, F4 adjust current axis by " );
grWriteln( " 1/50th of its range " );
grWriteln( "F5, F6 cycle through " );
grWriteln( " anti-aliasing modes P print PNG file " );
grWriteln( "L cycle through LCD q, ESC quit ftgrid " );
grWriteln( " filters" );
grLn();
grWriteln( "g, v adjust gamma value" );
/* |----------------------------------| |----------------------------------| */
grLn();
grLn();
......
......@@ -244,28 +244,6 @@ Engine::Engine(MainGUI* g)
"interpreter-version",
&ttInterpreterVersionDefault);
}
// auto-hinter
error = FT_Property_Get(library,
"autofitter",
"warping",
&doWarping);
if (error)
{
// no warping
haveWarping = 0;
doWarping = 0;
}
else
{
haveWarping = 1;
doWarping = 0; // we don't do warping by default
FT_Property_Set(library,
"autofitter",
"warping",
&doWarping);
}
}
......@@ -573,7 +551,6 @@ Engine::update()
doVerticalHinting = gui->verticalHintingCheckBox->isChecked();
doBlueZoneHinting = gui->blueZoneHintingCheckBox->isChecked();
showSegments = gui->segmentDrawingCheckBox->isChecked();
doWarping = gui->warpingCheckBox->isChecked();
gamma = gui->gammaSlider->value();
......
......@@ -99,8 +99,6 @@ private:
int fontType;
int haveWarping;
double pointSize;
double pixelSize;
unsigned int dpi;
......@@ -111,7 +109,6 @@ private:
bool doVerticalHinting;
bool doBlueZoneHinting;
bool showSegments;
bool doWarping;
double gamma;
......
......@@ -270,7 +270,6 @@ MainGUI::checkHinting()
verticalHintingCheckBox->setEnabled(false);
blueZoneHintingCheckBox->setEnabled(false);
segmentDrawingCheckBox->setEnabled(false);
warpingCheckBox->setEnabled(false);
antiAliasingComboBoxx->setItemEnabled(AntiAliasing_Light, false);
}
......@@ -312,8 +311,6 @@ MainGUI::checkAutoHinting()
verticalHintingCheckBox->setEnabled(true);
blueZoneHintingCheckBox->setEnabled(true);
segmentDrawingCheckBox->setEnabled(true);
if (engine->haveWarping)
warpingCheckBox->setEnabled(true);
antiAliasingComboBoxx->setItemEnabled(AntiAliasing_Light, true);
}
......@@ -330,7 +327,6 @@ MainGUI::checkAutoHinting()
verticalHintingCheckBox->setEnabled(false);
blueZoneHintingCheckBox->setEnabled(false);
segmentDrawingCheckBox->setEnabled(false);
warpingCheckBox->setEnabled(false);
antiAliasingComboBoxx->setItemEnabled(AntiAliasing_Light, false);
......@@ -740,7 +736,6 @@ MainGUI::createLayout()
verticalHintingCheckBox = new QCheckBox(tr("Vertical Hinting"));
blueZoneHintingCheckBox = new QCheckBox(tr("Blue-Zone Hinting"));
segmentDrawingCheckBox = new QCheckBox(tr("Segment Drawing"));
warpingCheckBox = new QCheckBox(tr("Warping"));
antiAliasingLabel = new QLabel(tr("Anti-Aliasing"));
antiAliasingLabel->setAlignment(Qt::AlignRight);
......@@ -824,10 +819,6 @@ MainGUI::createLayout()
segmentDrawingLayout->addSpacing(20); // XXX px
segmentDrawingLayout->addWidget(segmentDrawingCheckBox);
warpingLayout = new QHBoxLayout;
warpingLayout->addSpacing(20); // XXX px
warpingLayout->addWidget(warpingCheckBox);
antiAliasingLayout = new QHBoxLayout;
antiAliasingLayout->addWidget(antiAliasingLabel);
antiAliasingLayout->addWidget(antiAliasingComboBoxx);
......@@ -852,7 +843,6 @@ MainGUI::createLayout()
generalTabLayout->addLayout(verticalHintingLayout);
generalTabLayout->addLayout(blueZoneHintingLayout);
generalTabLayout->addLayout(segmentDrawingLayout);
generalTabLayout->addLayout(warpingLayout);
generalTabLayout->addSpacing(20); // XXX px
generalTabLayout->addStretch(1);
generalTabLayout->addLayout(antiAliasingLayout);
......
......@@ -133,7 +133,6 @@ private:
QCheckBox *showPointNumbersCheckBox;
QCheckBox *showPointsCheckBox;
QCheckBox *verticalHintingCheckBox;
QCheckBox *warpingCheckBox;
QComboBoxx *antiAliasingComboBoxx;
QComboBoxx *hintingModeComboBoxx;
......@@ -167,7 +166,6 @@ private:
QHBoxLayout *segmentDrawingLayout;
QHBoxLayout *sizeLayout;
QHBoxLayout *verticalHintingLayout;
QHBoxLayout *warpingLayout;
QLabel *antiAliasingLabel;
QLabel *dpiLabel;
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment