option to bypass ttfautohint for experimentation (it can have adverse effects);
authorwenzelm
Fri Apr 05 23:45:35 2019 +0200 (6 months ago)
changeset 700719a03e9d5f336
parent 70070 673a9d008123
child 70072 54dc58086351
option to bypass ttfautohint for experimentation (it can have adverse effects);
src/Pure/Admin/build_fonts.scala
     1.1 --- a/src/Pure/Admin/build_fonts.scala	Fri Apr 05 23:01:20 2019 +0200
     1.2 +++ b/src/Pure/Admin/build_fonts.scala	Fri Apr 05 23:45:35 2019 +0200
     1.3 @@ -210,6 +210,7 @@
     1.4      target_prefix: String = "Isabelle",
     1.5      target_version: String = "",
     1.6      target_dir: Path = default_target_dir,
     1.7 +    unhinted: Boolean = false,
     1.8      progress: Progress = No_Progress)
     1.9    {
    1.10      progress.echo("Directory " + target_dir)
    1.11 @@ -235,7 +236,8 @@
    1.12          progress.echo("Font " + target_file.toString + " ...")
    1.13          Isabelle_System.with_tmp_file("font", "ttf")(tmp_file =>
    1.14          {
    1.15 -          auto_hint(source_file, tmp_file)
    1.16 +          if (unhinted) File.copy(source_file, tmp_file)
    1.17 +          else auto_hint(source_file, tmp_file)
    1.18  
    1.19            Fontforge.execute(
    1.20              Fontforge.commands(
    1.21 @@ -319,16 +321,19 @@
    1.22      Isabelle_Tool("build_fonts", "construct Isabelle fonts", args =>
    1.23      {
    1.24        var source_dirs: List[Path] = Nil
    1.25 +      var unhinted = false
    1.26  
    1.27        val getopts = Getopts("""
    1.28  Usage: isabelle build_fonts [OPTIONS]
    1.29  
    1.30    Options are:
    1.31      -d DIR       additional source directory
    1.32 +    -u           unhinted font (bypass ttfautohint)
    1.33  
    1.34    Construct Isabelle fonts from DejaVu font families and Isabelle symbols.
    1.35  """,
    1.36 -        "d:" -> (arg => source_dirs = source_dirs ::: List(Path.explode(arg))))
    1.37 +        "d:" -> (arg => source_dirs = source_dirs ::: List(Path.explode(arg))),
    1.38 +        "u" -> (_ => unhinted = true))
    1.39  
    1.40        val more_args = getopts(args)
    1.41        if (more_args.nonEmpty) getopts.usage()
    1.42 @@ -339,6 +344,6 @@
    1.43        val progress = new Console_Progress
    1.44  
    1.45        build_fonts(source_dirs = source_dirs, target_dir = target_dir,
    1.46 -        target_version = target_version, progress = progress)
    1.47 +        target_version = target_version, unhinted = unhinted, progress = progress)
    1.48      })
    1.49  }