Skip to content

Instantly share code, notes, and snippets.

import glyphsets
from gflanguages import LoadLanguages
from fontTools import unicodedata
def get_decomposed_chars(glyphset_name, langs=None):
if langs is None:
langs = LoadLanguages()
allchars = set()
for lang_code in glyphsets.languages_per_glyphset(glyphset_name):
@moyogo
moyogo / glyphsapp-nicenames.py
Created February 16, 2024 15:36
Generate a text file with oldname=newname for Glyphs.app
# Generate a file with "oldname=newname" per glyph to rename with nice names.
# To use with https://github.com/mekkablue/Glyphs-Scripts to rename glyphs
for font in Glyphs.fonts:
renames = dict()
for glyph in font.glyphs:
new = Glyphs.niceGlyphName(glyph.name)
if new != glyph.name and new not in font.glyphs:
renames[glyph.name] = new
print(len(renames))
dirname = "/".join(font.filepath.split("/")[:-1])
@moyogo
moyogo / font_cldr_locales.py
Created October 15, 2019 13:20
Check language CLDR locales supported by a font
'''
Requires pyicu, fontTools
Authors:
Denis Moyogo Jacquerye [https://github.com/moyogo]
MIT License [https://opensource.org/licenses/MIT]
'''
import sys
import icu
@moyogo
moyogo / CustomParameters.md
Created October 25, 2017 13:16
Glyphs.app 1077 Custom Parameters
Custom Parameter Objects Type
ascender master unicode
Autohint instance int
Axes font list
Axis Location master list
blueScale font float
blueShift font int
capHeight master unicode
CJK Grid master int
@moyogo
moyogo / CustomParameters1.glyphs
Last active October 25, 2017 13:19
CustomParameters1.glyphs
{
.appVersion = "1073";
customParameters = (
{
name = glyphOrder;
value = (
"New Value"
);
},
{
@moyogo
moyogo / CustomParameters0.glyphs
Last active October 25, 2017 13:19
CustomParameters0.glyphs
{
.appVersion = "1073";
customParameters = (
{
name = glyphOrder;
value = "New Value";
},
{
name = "Family Alignment Zones";
value = New Value;