Commit ba40054c2dd9f5d3d8561de7106870ac6a920f6d

Werner Lemberg 2017-05-02T12:32:19

[autofit] Remove `slight' auto-hint mode again. A poll on freetype-devel favoured changes directly applied to `light'. * include/freetype/freetype.h (FT_LOAD_TARGET_SLIGHT, FT_RENDER_MODE_SLIGHT): Removed. * src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c (af_latin_hints_init), src/autofit/aflatin2.c (af_latin2_hints_init): Revert change from 2017-04-22. * src/autofit/afloader.c (af_loader_load_glyph) Remove references to FT_RENDER_MODE_SLIGHT. [AF_CONFIG_OPTION_TT_SIZE_METRICS]: Enable TrueType-like metrics unconditionally. * src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Revert change from 2017-04-22. * src/base/ftobjs.c (FT_Load_Glyph): Revert change from 2017-04-22. * src/pshinter/pshalgo.c (ps_hints_apply): Revert change from 2017-04-22. * src/smooth/ftsmooth.c (ft_smooth_render): Revert change from 2017-04-22. * docs/CHANGES: Updated.

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
diff --git a/ChangeLog b/ChangeLog
index b1ad07b..8dd013e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,35 @@
+2017-05-02  Werner Lemberg  <wl@gnu.org>
+
+	[autofit] Remove `slight' auto-hint mode again.
+
+	A poll on freetype-devel favoured changes directly applied to
+	`light'.
+
+	* include/freetype/freetype.h (FT_LOAD_TARGET_SLIGHT,
+	FT_RENDER_MODE_SLIGHT): Removed.
+
+	* src/autofit/afcjk.c (af_cjk_hints_init), src/autofit/aflatin.c
+	(af_latin_hints_init), src/autofit/aflatin2.c
+	(af_latin2_hints_init): Revert change from 2017-04-22.
+
+	* src/autofit/afloader.c (af_loader_load_glyph) Remove references to
+	FT_RENDER_MODE_SLIGHT.
+	[AF_CONFIG_OPTION_TT_SIZE_METRICS]: Enable TrueType-like metrics
+	unconditionally.
+
+	* src/base/ftadvanc.c (LOAD_ADVANCE_FAST_CHECK): Revert change from
+	2017-04-22.
+
+	* src/base/ftobjs.c (FT_Load_Glyph): Revert change from 2017-04-22.
+
+	* src/pshinter/pshalgo.c (ps_hints_apply): Revert change from
+	2017-04-22.
+
+	* src/smooth/ftsmooth.c (ft_smooth_render): Revert change from
+	2017-04-22.
+
+	* docs/CHANGES: Updated.
+
 2017-04-30  Werner Lemberg  <wl@gnu.org>
 
 	[autofit] Fix metrics computation.
diff --git a/docs/CHANGES b/docs/CHANGES
index 8df2b13..d96be35 100644
--- a/docs/CHANGES
+++ b/docs/CHANGES
@@ -3,7 +3,9 @@ CHANGES BETWEEN 2.7.1 and 2.8
 
   I. IMPORTANT CHANGES
 
-    - Support for OpenType Variation Fonts is now complete.
+    - Support for OpenType Variation Fonts is now complete.   The last
+      missing part was handling the `VVAR' and `MVAR' tables, which is
+      available with this release.
 
     - A new  function `FT_Face_Properties' allows the  control of some
       module  and   library  properties  per  font.    Currently,  the
@@ -19,12 +21,21 @@ CHANGES BETWEEN 2.7.1 and 2.8
 
         FREETYPE_PROPERTIES=pcf:no-long-family-names=1
 
-    - Variations font support now takes care of the `VVAR' and  `MVAR'
-      tables also.
-
 
   II. IMPORTANT BUG FIXES
 
+    - `Light' auto-hinting  mode no  longer uses TrueType  metrics for
+      TrueType  fonts.   This bug  was  introduced  in version  2.4.6,
+      causing   horizontal  scaling   also.    Almost  all   GNU/Linux
+      distributions (with Fedora as  a notable exception) disabled the
+      corresponding patch for good reasons; chances are thus high that
+      you won't notice a difference.
+
+      If  optical backward  compatibility for  legacy applications  is
+      necessary, you might enable the AF_CONFIG_OPTION_TT_SIZE_METRICS
+      configuration option.   However, it  is strongly  recommended to
+      avoid that, adjusting font sizes instead.
+
     - If a TrueType font gets loaded with FT_LOAD_NO_HINTING, FreeType
       now scales  the font linearly  again (bug introduced  in version
       2.4.6).
diff --git a/include/freetype/config/ftoption.h b/include/freetype/config/ftoption.h
index 69d30a4..1bf6e8f 100644
--- a/include/freetype/config/ftoption.h
+++ b/include/freetype/config/ftoption.h
@@ -909,11 +909,15 @@ FT_BEGIN_HEADER
 
   /*************************************************************************/
   /*                                                                       */
-  /* Use TrueType-like size metrics for `light' auto-hinting.  This option */
-  /* exists mainly for backwards compatibility with GNU/Linux              */
-  /* distributions like Fedora that did not un-patch the following change  */
-  /* (which was present in FreeType between versions 2.4.6 and 2.7.1,      */
-  /* inclusive).                                                           */
+  /* Use TrueType-like size metrics for `light' auto-hinting.              */
+  /*                                                                       */
+  /* It is strongly recommended to avoid this option, which exists only to */
+  /* help some legacy applications retain its appearance and behaviour     */
+  /* with respect to auto-hinted TrueType fonts.                           */
+  /*                                                                       */
+  /* The very reason this option exists at all are GNU/Linux distributions */
+  /* like Fedora that did not un-patch the following change (which was     */
+  /* present in FreeType between versions 2.4.6 and 2.7.1, inclusive).     */
   /*                                                                       */
   /*   2011-07-16  Steven Chu  <steven.f.chu@gmail.com>                    */
   /*                                                                       */
diff --git a/include/freetype/freetype.h b/include/freetype/freetype.h
index 681d8e9..c3bc704 100644
--- a/include/freetype/freetype.h
+++ b/include/freetype/freetype.h
@@ -221,7 +221,6 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*    FT_LOAD_TARGET_NORMAL                                              */
   /*    FT_LOAD_TARGET_LIGHT                                               */
-  /*    FT_LOAD_TARGET_SLIGHT                                              */
   /*    FT_LOAD_TARGET_MONO                                                */
   /*    FT_LOAD_TARGET_LCD                                                 */
   /*    FT_LOAD_TARGET_LCD_V                                               */
@@ -1756,12 +1755,37 @@ FT_BEGIN_HEADER
   /*    `slot->format' is also changed to @FT_GLYPH_FORMAT_BITMAP.         */
   /*                                                                       */
   /*    Here is a small pseudo code fragment that shows how to use         */
-  /*    `lsb_delta' and `rsb_delta' to improve (integer) positioning of    */
+  /*    `lsb_delta' and `rsb_delta' to do fractional positioning of        */
   /*    glyphs:                                                            */
   /*                                                                       */
   /*    {                                                                  */
-  /*      FT_Pos  origin_x       = 0;                                      */
-  /*      FT_Pos  prev_rsb_delta = 0;                                      */
+  /*      FT_GlyphSlot  slot     = face->glyph;                            */
+  /*      FT_Pos        origin_x = 0;                                      */
+  /*                                                                       */
+  /*                                                                       */
+  /*      for all glyphs do                                                */
+  /*        <load glyph with `FT_Load_Glyph'>                              */
+  /*                                                                       */
+  /*        FT_Outline_Translate( slot->outline, origin_x & 63, 0 );       */
+  /*                                                                       */
+  /*        <save glyph image, or render glyph, or ...>                    */
+  /*                                                                       */
+  /*        <compute kern between current and next glyph                   */
+  /*         and add it to `origin_x'>                                     */
+  /*                                                                       */
+  /*        origin_x += slot->advance.x;                                   */
+  /*        origin_x += slot->rsb_delta - slot->lsb_relta;                 */
+  /*      endfor                                                           */
+  /*    }                                                                  */
+  /*                                                                       */
+  /*    Here is another small pseudo code fragment that shows how to use   */
+  /*    `lsb_delta' and `rsb_delta' to improve integer positioning of      */
+  /*    glyphs:                                                            */
+  /*                                                                       */
+  /*    {                                                                  */
+  /*      FT_GlyphSlot  slot           = face->glyph;                      */
+  /*      FT_Pos        origin_x       = 0;                                */
+  /*      FT_Pos        prev_rsb_delta = 0;                                */
   /*                                                                       */
   /*                                                                       */
   /*      for all glyphs do                                                */
@@ -1770,16 +1794,16 @@ FT_BEGIN_HEADER
   /*                                                                       */
   /*        <load glyph with `FT_Load_Glyph'>                              */
   /*                                                                       */
-  /*        if ( prev_rsb_delta - face->glyph->lsb_delta >= 32 )           */
+  /*        if ( prev_rsb_delta - slot->lsb_delta >= 32 )                  */
   /*          origin_x -= 64;                                              */
-  /*        else if ( prev_rsb_delta - face->glyph->lsb_delta < -32 )      */
+  /*        else if ( prev_rsb_delta - slot->lsb_delta < -32 )             */
   /*          origin_x += 64;                                              */
   /*                                                                       */
-  /*        prev_rsb_delta = face->glyph->rsb_delta;                       */
+  /*        prev_rsb_delta = slot->rsb_delta;                              */
   /*                                                                       */
   /*        <save glyph image, or render glyph, or ...>                    */
   /*                                                                       */
-  /*        origin_x += face->glyph->advance.x;                            */
+  /*        origin_x += slot->advance.x;                                   */
   /*      endfor                                                           */
   /*    }                                                                  */
   /*                                                                       */
@@ -2937,8 +2961,8 @@ FT_BEGIN_HEADER
    *     rendering.  For monochrome output, use @FT_LOAD_TARGET_MONO
    *     instead.
    *
-   *   FT_LOAD_TARGET_SLIGHT ::
-   *     A slight hinting algorithm for gray-level modes.  Many generated
+   *   FT_LOAD_TARGET_LIGHT ::
+   *     A lighter hinting algorithm for gray-level modes.  Many generated
    *     glyphs are fuzzier but better resemble their original shape.  This
    *     is achieved by snapping glyphs to the pixel grid only vertically
    *     (Y-axis), as is done by FreeType's new CFF engine or Microsoft's
@@ -2947,25 +2971,16 @@ FT_BEGIN_HEADER
    *     driver, if the driver itself and the font support it, or by the
    *     auto-hinter.
    *
-   *     Advance widths are not rounded to integer values; instead, metrics
-   *     are based on linearly scaled values.  In particular this implies
-   *     that you have to apply sub-pixel rendering.
-   *
-   *   FT_LOAD_TARGET_LIGHT ::
-   *     This is similar to @FT_LOAD_TARGET_SLIGHT with a main difference:
-   *     It uses integer advance widths.
+   *     Advance widths are rounded to integer values; however, using the
+   *     `lsb_delta' and `rsb_delta' fields of @FT_GlyphSlotRec, it is
+   *     possible to get fractional advance widths for sub-pixel positioning
+   *     (which is recommended to use).
    *
    *     If configuration option AF_CONFIG_OPTION_TT_SIZE_METRICS is active,
    *     TrueType-like metrics are used to make this mode behave similarly
    *     as in unpatched FreeType versions between 2.4.6 and 2.7.1
    *     (inclusive).
    *
-   *     This hinting mode is deprecated.  In general,
-   *     @FT_LOAD_TARGET_SLIGHT always yields better results; additionally,
-   *     FT_LOAD_TARGET_LIGHT suffers from backwards compatibility issues
-   *     (see the documentation of AF_CONFIG_OPTION_TT_SIZE_METRICS in
-   *     `ftoption.h' for more details).
-   *
    *   FT_LOAD_TARGET_MONO ::
    *     Strong hinting algorithm that should only be used for monochrome
    *     output.  The result is probably unpleasant if the glyph is rendered
@@ -3001,18 +3016,17 @@ FT_BEGIN_HEADER
    *     }
    *
    *   In general, you should stick with one rendering mode.  For example,
-   *   switching between @FT_LOAD_TARGET_LIGHT and @FT_LOAD_TARGET_SLIGHT
-   *   enforces a lot of recomputation, which is slow.  Another reason is
-   *   caching: Selecting a different mode usually causes changes in both
-   *   the outlines and the rasterized bitmaps; it is thus necessary to
-   *   empty the cache after a mode switch to avoid false hits.
+   *   switching between @FT_LOAD_TARGET_NORMAL and @FT_LOAD_TARGET_MONO
+   *   enforces a lot of recomputation for TrueType fonts, which is slow.
+   *   Another reason is caching: Selecting a different mode usually causes
+   *   changes in both the outlines and the rasterized bitmaps; it is thus
+   *   necessary to empty the cache after a mode switch to avoid false hits.
    *
    */
 #define FT_LOAD_TARGET_( x )   ( (FT_Int32)( (x) & 15 ) << 16 )
 
 #define FT_LOAD_TARGET_NORMAL  FT_LOAD_TARGET_( FT_RENDER_MODE_NORMAL )
 #define FT_LOAD_TARGET_LIGHT   FT_LOAD_TARGET_( FT_RENDER_MODE_LIGHT  )
-#define FT_LOAD_TARGET_SLIGHT  FT_LOAD_TARGET_( FT_RENDER_MODE_SLIGHT )
 #define FT_LOAD_TARGET_MONO    FT_LOAD_TARGET_( FT_RENDER_MODE_MONO   )
 #define FT_LOAD_TARGET_LCD     FT_LOAD_TARGET_( FT_RENDER_MODE_LCD    )
 #define FT_LOAD_TARGET_LCD_V   FT_LOAD_TARGET_( FT_RENDER_MODE_LCD_V  )
@@ -3093,12 +3107,6 @@ FT_BEGIN_HEADER
   /*      indirectly to define hinting algorithm selectors.  See           */
   /*      @FT_LOAD_TARGET_XXX for details.                                 */
   /*                                                                       */
-  /*    FT_RENDER_MODE_SLIGHT ::                                           */
-  /*      This is equivalent to @FT_RENDER_MODE_NORMAL.  It is only        */
-  /*      defined as a separate value because render modes are also used   */
-  /*      indirectly to define hinting algorithm selectors.  See           */
-  /*      @FT_LOAD_TARGET_XXX for details.                                 */
-  /*                                                                       */
   /*    FT_RENDER_MODE_MONO ::                                             */
   /*      This mode corresponds to 1-bit bitmaps (with 2~levels of         */
   /*      opacity).                                                        */
@@ -3134,7 +3142,6 @@ FT_BEGIN_HEADER
     FT_RENDER_MODE_MONO,
     FT_RENDER_MODE_LCD,
     FT_RENDER_MODE_LCD_V,
-    FT_RENDER_MODE_SLIGHT,
 
     FT_RENDER_MODE_MAX
 
diff --git a/src/autofit/afcjk.c b/src/autofit/afcjk.c
index 86b8b40..61e29cd 100644
--- a/src/autofit/afcjk.c
+++ b/src/autofit/afcjk.c
@@ -1398,12 +1398,9 @@
       other_flags |= AF_LATIN_HINTS_VERT_SNAP;
 
     /*
-     *  We adjust stems to full pixels unless in `light', `slight',
-     *  or `lcd' mode.
+     *  We adjust stems to full pixels unless in `light' or `lcd' mode.
      */
-    if ( mode != FT_RENDER_MODE_LIGHT  &&
-         mode != FT_RENDER_MODE_SLIGHT &&
-         mode != FT_RENDER_MODE_LCD    )
+    if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
       other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
 
     if ( mode == FT_RENDER_MODE_MONO )
diff --git a/src/autofit/aflatin.c b/src/autofit/aflatin.c
index e03fdf0..11fa523 100644
--- a/src/autofit/aflatin.c
+++ b/src/autofit/aflatin.c
@@ -2577,9 +2577,7 @@
     /*
      *  We adjust stems to full pixels unless in `light' or `lcd' mode.
      */
-    if ( mode != FT_RENDER_MODE_LIGHT  &&
-         mode != FT_RENDER_MODE_SLIGHT &&
-         mode != FT_RENDER_MODE_LCD    )
+    if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
       other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
 
     if ( mode == FT_RENDER_MODE_MONO )
@@ -2592,10 +2590,8 @@
      *  However, if warping is enabled (which only works in `light' hinting
      *  mode), advance widths get adjusted, too.
      */
-    if ( mode == FT_RENDER_MODE_LIGHT                      ||
-         mode == FT_RENDER_MODE_SLIGHT                     ||
-         mode == FT_RENDER_MODE_LCD                        ||
-         ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
+    if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
+         ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0          )
       scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
 
 #ifdef AF_CONFIG_OPTION_USE_WARPER
diff --git a/src/autofit/aflatin2.c b/src/autofit/aflatin2.c
index 87ab91d..0607278 100644
--- a/src/autofit/aflatin2.c
+++ b/src/autofit/aflatin2.c
@@ -1560,9 +1560,7 @@
     /*
      *  We adjust stems to full pixels unless in `light' or `lcd' mode.
      */
-    if ( mode != FT_RENDER_MODE_LIGHT  &&
-         mode != FT_RENDER_MODE_SLIGHT &&
-         mode != FT_RENDER_MODE_LCD    )
+    if ( mode != FT_RENDER_MODE_LIGHT && mode != FT_RENDER_MODE_LCD )
       other_flags |= AF_LATIN_HINTS_STEM_ADJUST;
 
     if ( mode == FT_RENDER_MODE_MONO )
@@ -1572,10 +1570,8 @@
      *  In `light' or `lcd' mode we disable horizontal hinting completely.
      *  We also do it if the face is italic.
      */
-    if ( mode == FT_RENDER_MODE_LIGHT                      ||
-         mode == FT_RENDER_MODE_SLIGHT                     ||
-         mode == FT_RENDER_MODE_LCD                        ||
-         ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0 )
+    if ( mode == FT_RENDER_MODE_LIGHT || mode == FT_RENDER_MODE_LCD ||
+         ( face->style_flags & FT_STYLE_FLAG_ITALIC ) != 0          )
       scaler_flags |= AF_SCALER_FLAG_NO_HORIZONTAL;
 
 #ifdef AF_CONFIG_OPTION_USE_WARPER
diff --git a/src/autofit/afloader.c b/src/autofit/afloader.c
index b3269d1..ddf47eb 100644
--- a/src/autofit/afloader.c
+++ b/src/autofit/afloader.c
@@ -245,15 +245,14 @@
     if ( !size_internal->autohint_metrics.x_scale                          ||
          size_internal->autohint_mode != FT_LOAD_TARGET_MODE( load_flags ) )
     {
-      /* switching between LIGHT and SLIGHT (and vice versa) usually means */
-      /* different scaling values; this later on enforces recomputation of */
-      /* everything related to the current size                            */
+      /* switching between hinting modes usually means different scaling */
+      /* values; this later on enforces recomputation of everything      */
+      /* related to the current size                                     */
 
       size_internal->autohint_mode    = FT_LOAD_TARGET_MODE( load_flags );
       size_internal->autohint_metrics = size->metrics;
 
 #ifdef AF_CONFIG_OPTION_TT_SIZE_METRICS
-      if ( size_internal->autohint_mode != FT_RENDER_MODE_SLIGHT )
       {
         FT_Size_Metrics*  size_metrics = &size_internal->autohint_metrics;
 
@@ -382,12 +381,11 @@
      *
      */
 
-    /* stem darkening only works well in `light' and `slight' modes */
-    if ( ( scaler.render_mode == FT_RENDER_MODE_LIGHT  ||
-           scaler.render_mode == FT_RENDER_MODE_SLIGHT ) &&
+    /* stem darkening only works well in `light' mode */
+    if ( scaler.render_mode == FT_RENDER_MODE_LIGHT    &&
          ( !face->internal->no_stem_darkening        ||
            ( face->internal->no_stem_darkening < 0 &&
-             !module->no_stem_darkening            ) )   )
+             !module->no_stem_darkening            ) ) )
       af_loader_embolden_glyph_in_slot( loader, face, style_metrics );
 
     loader->transformed = slot_internal->glyph_transformed;
@@ -435,8 +433,7 @@
 
       /* we now need to adjust the metrics according to the change in */
       /* width/positioning that occurred during the hinting process   */
-      if ( scaler.render_mode != FT_RENDER_MODE_LIGHT  &&
-           scaler.render_mode != FT_RENDER_MODE_SLIGHT )
+      if ( scaler.render_mode != FT_RENDER_MODE_LIGHT )
       {
         FT_Pos  old_rsb, old_lsb, new_lsb;
         FT_Pos  pp1x_uh, pp2x_uh;
@@ -494,9 +491,8 @@
         }
       }
       /* `light' mode uses integer advance widths */
-      /* (but sets `lsb_delta' and `rsb_delta'),  */
-      /* `slight' mode uses fractional values     */
-      else if ( scaler.render_mode == FT_RENDER_MODE_LIGHT )
+      /* but sets `lsb_delta' and `rsb_delta'     */
+      else
       {
         FT_Pos  pp1x = loader->pp1.x;
         FT_Pos  pp2x = loader->pp2.x;
@@ -508,11 +504,6 @@
         slot->lsb_delta = loader->pp1.x - pp1x;
         slot->rsb_delta = loader->pp2.x - pp2x;
       }
-      else
-      {
-        slot->lsb_delta = 0;
-        slot->rsb_delta = 0;
-      }
 
       break;
 
@@ -563,7 +554,6 @@
       /* to keep the original rounded advance width; ditto for     */
       /* digits if all have the same advance width                 */
       if ( scaler.render_mode != FT_RENDER_MODE_LIGHT                       &&
-           scaler.render_mode != FT_RENDER_MODE_SLIGHT                      &&
            ( FT_IS_FIXED_WIDTH( slot->face )                              ||
              ( af_face_globals_is_digit( loader->globals, glyph_index ) &&
                style_metrics->digits_have_same_width                    ) ) )
@@ -587,8 +577,7 @@
       slot->metrics.vertAdvance = FT_MulFix( slot->metrics.vertAdvance,
                                              style_metrics->scaler.y_scale );
 
-      if ( scaler.render_mode != FT_RENDER_MODE_SLIGHT )
-        slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
+      slot->metrics.horiAdvance = FT_PIX_ROUND( slot->metrics.horiAdvance );
       slot->metrics.vertAdvance = FT_PIX_ROUND( slot->metrics.vertAdvance );
 
       slot->format  = FT_GLYPH_FORMAT_OUTLINE;
diff --git a/src/base/ftadvanc.c b/src/base/ftadvanc.c
index 5f2e0b1..1557607 100644
--- a/src/base/ftadvanc.c
+++ b/src/base/ftadvanc.c
@@ -59,15 +59,14 @@
    /*                                                              */
    /*  - unscaled load                                             */
    /*  - unhinted load                                             */
-   /*  - light-hinted and slight-hinted load                       */
+   /*  - light-hinted load                                         */
    /*  - if a variations font, it must have an `HVAR' or `VVAR'    */
    /*    table (thus the old MM or GX fonts don't qualify; this    */
    /*    gets checked by the driver-specific functions)            */
 
-#define LOAD_ADVANCE_FAST_CHECK( face, flags )                           \
-          ( flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING )         || \
-            ( FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_LIGHT  ||   \
-              FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_SLIGHT ) )
+#define LOAD_ADVANCE_FAST_CHECK( face, flags )                      \
+          ( flags & ( FT_LOAD_NO_SCALE | FT_LOAD_NO_HINTING )    || \
+            FT_LOAD_TARGET_MODE( flags ) == FT_RENDER_MODE_LIGHT )
 
 
   /* documentation is in ftadvanc.h */
diff --git a/src/base/ftobjs.c b/src/base/ftobjs.c
index cbc7713..539116e 100644
--- a/src/base/ftobjs.c
+++ b/src/base/ftobjs.c
@@ -668,8 +668,8 @@
      * - Then, auto-hint if FT_LOAD_FORCE_AUTOHINT is set or if we don't
      *   have a native font hinter.
      *
-     * - Otherwise, auto-hint for LIGHT or SLIGHT hinting mode or if there
-     *   isn't any hinting bytecode in the TrueType/OpenType font.
+     * - Otherwise, auto-hint for LIGHT hinting mode or if there isn't
+     *   any hinting bytecode in the TrueType/OpenType font.
      *
      * - Exception: The font is `tricky' and requires the native hinter to
      *   load properly.
@@ -702,9 +702,8 @@
         /* check the size of the `fpgm' and `prep' tables, too --    */
         /* the assumption is that there don't exist real TTFs where  */
         /* both `fpgm' and `prep' tables are missing                 */
-        if ( ( ( mode == FT_RENDER_MODE_LIGHT  ||
-                 mode == FT_RENDER_MODE_SLIGHT )              &&
-               !FT_DRIVER_HINTS_LIGHTLY( driver )             ) ||
+        if ( ( mode == FT_RENDER_MODE_LIGHT       &&
+               !FT_DRIVER_HINTS_LIGHTLY( driver ) )             ||
              ( FT_IS_SFNT( face )                             &&
                ttface->num_locations                          &&
                ttface->max_profile.maxSizeOfInstructions == 0 &&
diff --git a/src/pshinter/pshalgo.c b/src/pshinter/pshalgo.c
index 27cb229..9ad1a3a 100644
--- a/src/pshinter/pshalgo.c
+++ b/src/pshinter/pshalgo.c
@@ -2149,8 +2149,7 @@
       glyph->do_vert_snapping = FT_BOOL( hint_mode == FT_RENDER_MODE_MONO  ||
                                          hint_mode == FT_RENDER_MODE_LCD_V );
 
-      glyph->do_stem_adjust = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT  &&
-                                       hint_mode != FT_RENDER_MODE_SLIGHT );
+      glyph->do_stem_adjust   = FT_BOOL( hint_mode != FT_RENDER_MODE_LIGHT );
 
       for ( dimension = 0; dimension < 2; dimension++ )
       {
diff --git a/src/smooth/ftsmooth.c b/src/smooth/ftsmooth.c
index 52e61e5..435854e 100644
--- a/src/smooth/ftsmooth.c
+++ b/src/smooth/ftsmooth.c
@@ -433,8 +433,7 @@
                     FT_Render_Mode    mode,
                     const FT_Vector*  origin )
   {
-    if ( mode == FT_RENDER_MODE_LIGHT  ||
-         mode == FT_RENDER_MODE_SLIGHT )
+    if ( mode == FT_RENDER_MODE_LIGHT )
       mode = FT_RENDER_MODE_NORMAL;
 
     return ft_smooth_render_generic( render, slot, mode, origin,
diff --git a/src/truetype/ttgload.c b/src/truetype/ttgload.c
index c5d548f..9c1e109 100644
--- a/src/truetype/ttgload.c
+++ b/src/truetype/ttgload.c
@@ -2737,7 +2737,7 @@
     /* TrueType glyphs at all sizes using the bytecode interpreter. */
     /*                                                              */
     if ( !( load_flags & FT_LOAD_NO_SCALE ) &&
-         size->metrics->y_ppem < 24          )
+         size->metrics->y_ppem < 24         )
       glyph->outline.flags |= FT_OUTLINE_HIGH_PRECISION;
 
   Exit:
diff --git a/src/truetype/ttobjs.c b/src/truetype/ttobjs.c
index 64011e8..d20e3da 100644
--- a/src/truetype/ttobjs.c
+++ b/src/truetype/ttobjs.c
@@ -1234,6 +1234,7 @@
     /*                                                               */
     if ( face->header.Flags & 8 )
     {
+      /* the TT spec always asks for ROUND, not FLOOR or CEIL */
       size_metrics->ascender = FT_PIX_ROUND(
                                  FT_MulFix( face->root.ascender,
                                             size_metrics->y_scale ) );
@@ -1252,6 +1253,8 @@
 
     if ( face->header.Flags & 8 )
     {
+      /* base scaling values on integer ppem values, */
+      /* as mandated by the TrueType specification   */
       size_metrics->x_scale = FT_DivFix( size_metrics->x_ppem << 6,
                                          face->root.units_per_EM );
       size_metrics->y_scale = FT_DivFix( size_metrics->y_ppem << 6,