option to bypass ttfautohint for experimentation (it can have adverse effects);
authorwenzelm
Fri, 05 Apr 2019 23:45:35 +0200
changeset 70071 9a03e9d5f336
parent 70070 673a9d008123
child 70072 54dc58086351
option to bypass ttfautohint for experimentation (it can have adverse effects);
src/Pure/Admin/build_fonts.scala
--- a/src/Pure/Admin/build_fonts.scala	Fri Apr 05 23:01:20 2019 +0200
+++ b/src/Pure/Admin/build_fonts.scala	Fri Apr 05 23:45:35 2019 +0200
@@ -210,6 +210,7 @@
     target_prefix: String = "Isabelle",
     target_version: String = "",
     target_dir: Path = default_target_dir,
+    unhinted: Boolean = false,
     progress: Progress = No_Progress)
   {
     progress.echo("Directory " + target_dir)
@@ -235,7 +236,8 @@
         progress.echo("Font " + target_file.toString + " ...")
         Isabelle_System.with_tmp_file("font", "ttf")(tmp_file =>
         {
-          auto_hint(source_file, tmp_file)
+          if (unhinted) File.copy(source_file, tmp_file)
+          else auto_hint(source_file, tmp_file)
 
           Fontforge.execute(
             Fontforge.commands(
@@ -319,16 +321,19 @@
     Isabelle_Tool("build_fonts", "construct Isabelle fonts", args =>
     {
       var source_dirs: List[Path] = Nil
+      var unhinted = false
 
       val getopts = Getopts("""
 Usage: isabelle build_fonts [OPTIONS]
 
   Options are:
     -d DIR       additional source directory
+    -u           unhinted font (bypass ttfautohint)
 
   Construct Isabelle fonts from DejaVu font families and Isabelle symbols.
 """,
-        "d:" -> (arg => source_dirs = source_dirs ::: List(Path.explode(arg))))
+        "d:" -> (arg => source_dirs = source_dirs ::: List(Path.explode(arg))),
+        "u" -> (_ => unhinted = true))
 
       val more_args = getopts(args)
       if (more_args.nonEmpty) getopts.usage()
@@ -339,6 +344,6 @@
       val progress = new Console_Progress
 
       build_fonts(source_dirs = source_dirs, target_dir = target_dir,
-        target_version = target_version, progress = progress)
+        target_version = target_version, unhinted = unhinted, progress = progress)
     })
 }