# HG changeset patch # User wenzelm # Date 1543498991 -3600 # Node ID 69de0f5618247a97d9532d9b8c963ff81422c462 # Parent 3539767d5c6102180908f19b07ab125592492a8a clarified target_dir; diff -r 3539767d5c61 -r 69de0f561824 src/Pure/Admin/build_fonts.scala --- a/src/Pure/Admin/build_fonts.scala Thu Nov 29 12:43:11 2018 +0100 +++ b/src/Pure/Admin/build_fonts.scala Thu Nov 29 14:43:11 2018 +0100 @@ -179,14 +179,17 @@ val default_sources: List[Family] = List(Family.deja_vu_sans_mono, Family.deja_vu_sans, Family.deja_vu_serif) + val default_target_dir: Path = Path.explode("isabelle_fonts") + def build_fonts( sources: List[Family] = default_sources, source_dirs: List[Path] = Nil, target_prefix: String = "Isabelle", target_version: String = "", - target_dir: Path = Path.current, + target_dir: Path = default_target_dir, progress: Progress = No_Progress) { + progress.echo("Directory " + target_dir) Isabelle_System.mkdirs(target_dir) val font_dirs = source_dirs ::: List(Path.explode("~~/Admin/isabelle_fonts")) @@ -206,7 +209,7 @@ val target_names = source_names.update(prefix = target_prefix, version = target_version) val target_file = target_dir + target_names.ttf - progress.echo("Creating " + target_file.toString + " ...") + progress.echo("Font " + target_file.toString + " ...") Fontforge.execute( Fontforge.commands( Fontforge.open(isabelle_file), @@ -238,7 +241,7 @@ val target_names = Fontforge.font_names(vacuous_file) val target_file = target_dir + target_names.ttf - progress.echo("Creating " + target_file.toString + " ...") + progress.echo("Font " + target_file.toString + " ...") val domain = (for ((target_file, index) <- targets if index == 0) @@ -270,25 +273,26 @@ Isabelle_Tool("build_fonts", "construct Isabelle fonts", args => { var source_dirs: List[Path] = Nil - var target_dir = Path.current val getopts = Getopts(""" Usage: isabelle build_fonts [OPTIONS] Options are: - -D DIR target directory (default ".") -d DIR additional source directory Construct Isabelle fonts from DejaVu font families and Isabelle symbols. """, - "D:" -> (arg => target_dir = Path.explode(arg)), "d:" -> (arg => source_dirs = source_dirs ::: List(Path.explode(arg)))) val more_args = getopts(args) if (more_args.nonEmpty) getopts.usage() + val target_version = Date.Format("uuuuMMdd")(Date.now()) + val target_dir = Path.explode("isabelle_fonts-" + target_version) + val progress = new Console_Progress - build_fonts(source_dirs = source_dirs, target_dir = target_dir, progress = progress) + build_fonts(source_dirs = source_dirs, target_dir = target_dir, + target_version = target_version, progress = progress) }) }