... |
... |
@@ -852,22 +852,21 @@ |
852
|
852
|
|
853
|
853
|
#endif
|
854
|
854
|
|
855
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
856
|
855
|
/* Save possibly modified glyph phantom points unless in v40 backward */
|
857
|
856
|
/* compatibility mode, where no movement on the x axis means no reason */
|
858
|
857
|
/* to change bearings or advance widths. */
|
859
|
|
- if ( !( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
|
860
|
|
- exec->backward_compatibility ) )
|
861
|
|
- {
|
862
|
|
-#endif
|
863
|
|
- loader->pp1 = zone->cur[zone->n_points - 4];
|
864
|
|
- loader->pp2 = zone->cur[zone->n_points - 3];
|
865
|
|
- loader->pp3 = zone->cur[zone->n_points - 2];
|
866
|
|
- loader->pp4 = zone->cur[zone->n_points - 1];
|
|
858
|
+
|
867
|
859
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
868
|
|
- }
|
|
860
|
+ if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
|
|
861
|
+ exec->backward_compatibility )
|
|
862
|
+ return FT_Err_Ok;
|
869
|
863
|
#endif
|
870
|
864
|
|
|
865
|
+ loader->pp1 = zone->cur[zone->n_points - 4];
|
|
866
|
+ loader->pp2 = zone->cur[zone->n_points - 3];
|
|
867
|
+ loader->pp3 = zone->cur[zone->n_points - 2];
|
|
868
|
+ loader->pp4 = zone->cur[zone->n_points - 1];
|
|
869
|
+
|
871
|
870
|
return FT_Err_Ok;
|
872
|
871
|
}
|
873
|
872
|
|
... |
... |
@@ -1365,36 +1364,31 @@ |
1365
|
1364
|
static void
|
1366
|
1365
|
tt_loader_set_pp( TT_Loader loader )
|
1367
|
1366
|
{
|
1368
|
|
- FT_Bool subpixel_hinting = 0;
|
1369
|
|
- FT_Bool grayscale = 0;
|
1370
|
|
- FT_Bool use_aw_2 = 0;
|
1371
|
|
-
|
1372
|
|
-#ifdef TT_CONFIG_OPTION_SUBPIXEL_HINTING
|
1373
|
|
- TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( loader->face );
|
1374
|
|
-#endif
|
1375
|
|
-
|
1376
|
|
-
|
1377
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
1378
|
|
- if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
|
1379
|
|
- {
|
1380
|
|
- subpixel_hinting = loader->exec ? loader->exec->subpixel_hinting_lean
|
1381
|
|
- : 0;
|
1382
|
|
- grayscale = loader->exec ? loader->exec->grayscale_cleartype
|
1383
|
|
- : 0;
|
1384
|
|
- }
|
1385
|
|
-#endif
|
1386
|
|
-
|
1387
|
|
- use_aw_2 = FT_BOOL( subpixel_hinting && grayscale );
|
1388
|
|
-
|
1389
|
1367
|
loader->pp1.x = loader->bbox.xMin - loader->left_bearing;
|
1390
|
1368
|
loader->pp1.y = 0;
|
1391
|
1369
|
loader->pp2.x = loader->pp1.x + loader->advance;
|
1392
|
1370
|
loader->pp2.y = 0;
|
1393
|
1371
|
|
1394
|
|
- loader->pp3.x = use_aw_2 ? loader->advance / 2 : 0;
|
|
1372
|
+ loader->pp3.x = 0;
|
1395
|
1373
|
loader->pp3.y = loader->bbox.yMax + loader->top_bearing;
|
1396
|
|
- loader->pp4.x = use_aw_2 ? loader->advance / 2 : 0;
|
|
1374
|
+ loader->pp4.x = 0;
|
1397
|
1375
|
loader->pp4.y = loader->pp3.y - loader->vadvance;
|
|
1376
|
+
|
|
1377
|
+#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
|
1378
|
+ {
|
|
1379
|
+ TT_Driver driver = (TT_Driver)FT_FACE_DRIVER( loader->face );
|
|
1380
|
+
|
|
1381
|
+
|
|
1382
|
+ if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 &&
|
|
1383
|
+ loader->exec &&
|
|
1384
|
+ loader->exec->subpixel_hinting_lean &&
|
|
1385
|
+ loader->exec->grayscale_cleartype )
|
|
1386
|
+ {
|
|
1387
|
+ loader->pp3.x = loader->advance / 2;
|
|
1388
|
+ loader->pp4.x = loader->advance / 2;
|
|
1389
|
+ }
|
|
1390
|
+ }
|
|
1391
|
+#endif
|
1398
|
1392
|
}
|
1399
|
1393
|
|
1400
|
1394
|
|
... |
... |
@@ -2221,6 +2215,9 @@ |
2221
|
2215
|
if ( !exec )
|
2222
|
2216
|
return FT_THROW( Could_Not_Find_Context );
|
2223
|
2217
|
|
|
2218
|
+ grayscale = FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
|
|
2219
|
+ FT_RENDER_MODE_MONO );
|
|
2220
|
+
|
2224
|
2221
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
2225
|
2222
|
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
|
2226
|
2223
|
{
|
... |
... |
@@ -2237,6 +2234,7 @@ |
2237
|
2234
|
FT_BOOL( subpixel_hinting_lean &&
|
2238
|
2235
|
( load_flags &
|
2239
|
2236
|
FT_LOAD_TARGET_LCD_V ) );
|
|
2237
|
+ grayscale = FT_BOOL( grayscale && !subpixel_hinting_lean );
|
2240
|
2238
|
}
|
2241
|
2239
|
else
|
2242
|
2240
|
{
|
... |
... |
@@ -2246,22 +2244,11 @@ |
2246
|
2244
|
}
|
2247
|
2245
|
#endif
|
2248
|
2246
|
|
2249
|
|
-#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
2250
|
|
- if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
|
2251
|
|
- grayscale = FT_BOOL( !subpixel_hinting_lean &&
|
2252
|
|
- FT_LOAD_TARGET_MODE( load_flags ) !=
|
2253
|
|
- FT_RENDER_MODE_MONO );
|
2254
|
|
- else
|
2255
|
|
-#endif
|
2256
|
|
- grayscale = FT_BOOL( FT_LOAD_TARGET_MODE( load_flags ) !=
|
2257
|
|
- FT_RENDER_MODE_MONO );
|
2258
|
|
-
|
2259
|
2247
|
error = TT_Load_Context( exec, face, size );
|
2260
|
2248
|
if ( error )
|
2261
|
2249
|
return error;
|
2262
|
2250
|
|
2263
|
2251
|
{
|
2264
|
|
-
|
2265
|
2252
|
#ifdef TT_SUPPORT_SUBPIXEL_HINTING_MINIMAL
|
2266
|
2253
|
if ( driver->interpreter_version == TT_INTERPRETER_VERSION_40 )
|
2267
|
2254
|
{
|