MCPcopy
hub / github.com/subframe7536/maple-font / __init__

Method __init__

build.py:669–712  ·  view source on GitHub ↗
(self, use_hinted: bool)

Source from the content-addressed store, hash-verified

667
668class BuildOption:
669 def __init__(self, use_hinted: bool):
670 # paths
671 self.src_dir = "source"
672 self.output_dir = "fonts"
673 self.output_otf = joinPaths(self.output_dir, "OTF")
674 self.output_ttf = joinPaths(self.output_dir, "TTF")
675 self.output_ttf_hinted = joinPaths(self.output_dir, "TTF-AutoHint")
676 self.output_variable = joinPaths(self.output_dir, "Variable")
677 self.output_woff2 = joinPaths(self.output_dir, "Woff2")
678 self.output_nf = joinPaths(self.output_dir, "NF")
679 self.ttf_base_dir = joinPaths(
680 self.output_dir, "TTF-AutoHint" if use_hinted else "TTF"
681 )
682
683 self.cn_variable_dir = f"{self.src_dir}/cn"
684 self.cn_static_dir = f"{self.cn_variable_dir}/static"
685
686 self.cn_suffix = None
687 self.cn_suffix_compact = None
688 self.cn_base_font_dir = ""
689 self.output_cn = ""
690 # In these subfamilies:
691 # - NameID1 should be the family name
692 # - NameID2 should be the subfamily name
693 # - NameID16 and NameID17 should be removed
694 # Other subfamilies:
695 # - NameID1 should be the family name, append with subfamily name without "Italic"
696 # - NameID2 should be the "Regular" or "Italic"
697 # - NameID16 should be the family name
698 # - NameID17 should be the subfamily name
699 # https://github.com/subframe7536/maple-font/issues/182
700 # https://github.com/subframe7536/maple-font/issues/183
701 #
702 # same as `ftcli assistant commit . --ls 400 700`
703 # https://github.com/ftCLI/FoundryTools-CLI/issues/166#issuecomment-2095756721
704 self.base_subfamily_list = ["Regular", "Bold", "Italic", "BoldItalic"]
705 self.is_nf_built = False
706 self.is_cn_built = False
707 self.has_cache = (
708 self.__check_file_count(self.output_variable, minCount=2, end=".ttf")
709 and self.__check_file_count(self.output_ttf, minCount=4, end=".ttf")
710 and self.__check_file_count(self.output_ttf_hinted, minCount=4, end=".ttf")
711 )
712 self.github_mirror = environ.get("GITHUB", "github.com")
713
714 def get_feature_file_path(self, is_italic: bool, is_cn: bool = False) -> str:
715 return joinPaths(

Callers

nothing calls this directly

Calls 3

__check_file_countMethod · 0.95
joinPathsFunction · 0.90
getMethod · 0.80

Tested by

no test coverage detected