[cantarell-fonts] Stop generating obliques.



commit d4ed74c0ee20b0150c097a7b86b24bba026b002e
Author: Nikolaus Waxweiler <madigens gmail com>
Date:   Sun May 7 19:23:03 2017 +0200

    Stop generating obliques.
    
    FontForge's (scripting) quirks have been making this difficult and it
    makes little sense to invest time into a standalone oblique while I'm
    making modifications to the base glyphs.

 scripts/generate.sh      |   71 ----------------------------------------------
 scripts/test-coverage.py |    4 +-
 2 files changed, 2 insertions(+), 73 deletions(-)
---
diff --git a/scripts/generate.sh b/scripts/generate.sh
index 5c3d765..a2e50d1 100755
--- a/scripts/generate.sh
+++ b/scripts/generate.sh
@@ -14,9 +14,6 @@ while (i < $argc)
     if (Validate(1))
       Error($argv[i] + " did not pass validation. Tolerate no technical flaws in the source! Run 'Validate' 
in FontForge to see and fix what's wrong. The generated files might not validate completely due to the way 
FontForge scripting seems to work..")
     endif
-    
-    SelectAll()
-    CorrectDirection()
 
     SelectGlyphsBoth()
     UnlinkReference()
@@ -30,73 +27,5 @@ while (i < $argc)
     RoundToInt()
     Generate($fontname + ".otf")
 
-    # Using RoundToInt() above doesn't actually round everything to int. Ugh.
-    # Workaround: open generated file and RoundToInt() there, then regenerate.
-    # This can mess with the PS Private dictionary. Gah!
-    #Open($fontname + ".otf")
-    #SelectAll()
-    #RoundToInt()
-    #Generate($fontname + ".otf")
-    #
-    #Open($argv[i])
-
-    ###
-    # Generate synthetic oblique. Better than nothing.
-    SetItalicAngle(-8)
-
-    weight=GetTTFName(0x409,2)
-    if ($weight == "Regular") 
-      SetTTFName(0x409, 2, "Oblique")
-      SetFontNames("Cantarell-Oblique", "", "Cantarell Oblique")
-    else
-      SetTTFName(0x409, 2, "BoldOblique")
-      SetFontNames("Cantarell-BoldOblique", "", "Cantarell Bold Oblique")
-    endif
-
-    # XXX: Does not work from the script, only works when done through the GUI.
-#    # To keep references, selectively unlink and remove overlap. First select
-#    # glyphs constructed out of references and splines and turn them into
-#    # splines-only. Also unlink diacritics and some misc. glyphs if they are
-#    # constructed out of other diacritics (e.g. 2x dotaccent -> dieresis). Skew
-#    # won't work correctly otherwise.
-#    SelectGlyphsBoth()
-#    SelectMore(0u02c6, 0u0331)
-#    SelectMore(0u0022)
-#    SelectMore(0u003a, 0u003b)
-#    UnlinkReference()
-#    RemoveOverlap()
-#    Simplify(1 | 8 | 16 | 32 | 64 | 128)
-#    RoundToInt()
-
-    SelectAll()
-    UnlinkReference()
-    RemoveOverlap()
-    Simplify(1 | 8 | 16 | 32 | 64 | 128, 1)
-    RoundToInt()
-    Skew(8)
-    AddExtrema()
-    Simplify(1 | 8 | 16 | 32 | 64 | 128, 1)
-    RoundToInt()
-
-    # Can't validate oblique'd font because RoundToInt doesn't seem to round
-    # control handles to integers, causing missing extrema on a few glyphs that
-    # disappear when manually rounding to int in the GUI.
-    #if (Validate(1))
-    #  Error("Oblique'd " + $argv[i] + " did not pass validation. Fix the script.")
-    #endif
-
-    # Deselect combining diacritics before tightening spacing of the oblique.
-    # The tightening has been calculated according to Thomas Phinney's
-    # presentation on "How to Space a font", H * (tan i) = left shift, where H
-    # is 0.5 * average(cap height, x height) and i is the italic angle. I
-    # halved the result because it looks better.
-    SelectGlyphsSplines()
-    SelectFewer(0u0300, 0u0331)
-    Move(-20, 0)
-
-    AutoHint()
-    Generate($fontname + ".otf")
-    Close()
-
     i++
 endloop
diff --git a/scripts/test-coverage.py b/scripts/test-coverage.py
index e4a25c8..e3501a8 100755
--- a/scripts/test-coverage.py
+++ b/scripts/test-coverage.py
@@ -47,7 +47,7 @@ for charset in charset_list:
     # Font can contain multiple cmaps that map unicode code points (U+0020) to
     # glyph names ("space"), we want the code points from all Unicode cmaps and
     # flatten them into a (unique) set.
-    codepoints = [[y[0] for y in x.cmap.items()] 
+    codepoints = [[y[0] for y in x.cmap.items()]
                   for x in font['cmap'].tables if x.isUnicode()]
     codepoints_set = frozenset([item for sublist in codepoints
                                for item in sublist])
@@ -57,7 +57,7 @@ for charset in charset_list:
       font_filename = os.path.basename(font_file)
       charset_filename = charset.rpartition("/")[-1]
       print("\n" + font_filename + " is missing from " + charset_filename + ":")
-      
+
       for m in missing_codepoints:
         print("U+" + format(m, "04X") + " " + charset_table[m])
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]