diff --git a/Lib/gftools/html.py b/Lib/gftools/html.py index 52f1f4168..1efff50f6 100644 --- a/Lib/gftools/html.py +++ b/Lib/gftools/html.py @@ -22,6 +22,7 @@ font_is_italic, partition, get_encoded_glyphs, + get_encoded_glyphs_from_fonts, ) @@ -496,7 +497,8 @@ def __init__( self.sample_text = " ".join(font_sample_text(self.ttFonts[0])) # TODO to collect unencoded glyphs, we need to make a better version # of hbinput - self.glyphs = get_encoded_glyphs(self.ttFonts[0]) + self.glyphs = get_encoded_glyphs_from_fonts(self.ttFonts) + self.encoded_glyphs = {css_class: get_encoded_glyphs(self.ttFonts[i]) for i, css_class in enumerate(self.css_font_classes)} def partition(self): with tempfile.TemporaryDirectory() as tmp_out: @@ -553,7 +555,7 @@ def __init__( self.too_big_for_browserstack = len(self.css_font_classes_before) > 4 self.sample_text = " ".join(font_sample_text(self.ttFonts_before[0])) - self.glyphs = get_encoded_glyphs(self.ttFonts_before[0]) + self.glyphs = get_encoded_glyphs_fonts(self.ttFonts_before) def _match_css_font_classes(self): """Match css font classes by full names for static fonts and diff --git a/Lib/gftools/templates/family.html b/Lib/gftools/templates/family.html new file mode 100644 index 000000000..86475200e --- /dev/null +++ b/Lib/gftools/templates/family.html @@ -0,0 +1,85 @@ +{% extends "_base.html" %} +{% block title %}Glyphs{% endblock %} +{% block style %} +{{ super() }} +.cell{ + position: relative; + z-index: -1; + float: left; + background-color: #fcfcfc; + display: block; + text-align: center; + padding: 5pt; + margin: 5pt; + width: {{ pt_size | int * 1.5 }}px; + line-height: {{ pt_size | int * 1.5}}px; +} +.box-title-family{ + width: {{ pt_size }}pt; + float: left; + font-size: 8pt; + font-weight: 700; + padding-top: 5px; + margin-bottom: 10pt; + display: block; +} +.wrapper_box{ + display: flex; + padding: 5pt; + margin: 5pt; + width: 24px; + top: 240px; +} +.wrapper_title{ + display: flex; + padding: 5pt; + margin: 5pt; + width: 24px; + /* position: fixed; */ + top: 200px; +} +.wrapper_content{ + display: block; +} +.title_rotated { + transform: rotate(-90deg); + white-space:nowrap; + display:block; +} +.error{ + background-color: #D0342C; + color: #fcfcfc; +} + +{% endblock %} + +{% block content_name %} +