mirror of
https://github.com/daylinmorgan/monolisa-nerdfont-patch.git
synced 2024-12-22 06:50:44 -06:00
chore: change batteries
This commit is contained in:
parent
67e41cd362
commit
2603e90ce8
1 changed files with 14 additions and 2 deletions
16
font-patcher
16
font-patcher
|
@ -6,7 +6,7 @@
|
||||||
from __future__ import absolute_import, print_function, unicode_literals
|
from __future__ import absolute_import, print_function, unicode_literals
|
||||||
|
|
||||||
# Change the script version when you edit this script:
|
# Change the script version when you edit this script:
|
||||||
script_version = "4.8.3"
|
script_version = "4.8.4"
|
||||||
|
|
||||||
version = "3.1.1"
|
version = "3.1.1"
|
||||||
projectName = "Nerd Fonts"
|
projectName = "Nerd Fonts"
|
||||||
|
@ -1154,7 +1154,7 @@ class font_patcher:
|
||||||
if our_btb == hhea_btb:
|
if our_btb == hhea_btb:
|
||||||
metrics = Metric.TYPO if use_typo else Metric.WIN # conforming font
|
metrics = Metric.TYPO if use_typo else Metric.WIN # conforming font
|
||||||
elif abs(our_btb - hhea_btb) / our_btb < 0.03:
|
elif abs(our_btb - hhea_btb) / our_btb < 0.03:
|
||||||
logger.info("Font vertical metrics slightly off (%.1f%)", (our_btb - hhea_btb) / our_btb * 100.0)
|
logger.info("Font vertical metrics slightly off (%.1f%%)", (our_btb - hhea_btb) / our_btb * 100.0)
|
||||||
metrics = Metric.TYPO if use_typo else Metric.WIN
|
metrics = Metric.TYPO if use_typo else Metric.WIN
|
||||||
else:
|
else:
|
||||||
# Try the other metric
|
# Try the other metric
|
||||||
|
@ -1411,6 +1411,18 @@ class font_patcher:
|
||||||
# Just prepare scaling of existing glyphs
|
# Just prepare scaling of existing glyphs
|
||||||
glyph_scale_data = self.get_glyph_scale(sym_glyph.encoding, scaleRules, stretch, self.sourceFont, currentSourceFontGlyph) if scaleRules is not None else None
|
glyph_scale_data = self.get_glyph_scale(sym_glyph.encoding, scaleRules, stretch, self.sourceFont, currentSourceFontGlyph) if scaleRules is not None else None
|
||||||
else:
|
else:
|
||||||
|
# Break apart multiple unicodes linking to one glyph
|
||||||
|
if currentSourceFontGlyph in self.sourceFont:
|
||||||
|
altuni = self.sourceFont[currentSourceFontGlyph].altuni
|
||||||
|
if altuni:
|
||||||
|
codes = { v for v, s, r in altuni if v >= 0 }
|
||||||
|
codes.add(self.sourceFont[currentSourceFontGlyph].unicode)
|
||||||
|
codes.remove(currentSourceFontGlyph)
|
||||||
|
codes = [ "{:04X}".format(c) for c in sorted(list(codes)) ]
|
||||||
|
logger.debug("Removing alternate unicode on %X (%s)", currentSourceFontGlyph, ' '.join(codes));
|
||||||
|
self.sourceFont[currentSourceFontGlyph].altuni = None
|
||||||
|
self.sourceFont.encoding = 'UnicodeFull' # Rebuild encoding table (needed after altuni changes)
|
||||||
|
|
||||||
# This will destroy any content currently in currentSourceFontGlyph, so do it first
|
# This will destroy any content currently in currentSourceFontGlyph, so do it first
|
||||||
glyph_scale_data = self.get_glyph_scale(sym_glyph.encoding, scaleRules, stretch, symbolFont, currentSourceFontGlyph) if scaleRules is not None else None
|
glyph_scale_data = self.get_glyph_scale(sym_glyph.encoding, scaleRules, stretch, symbolFont, currentSourceFontGlyph) if scaleRules is not None else None
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue