### Install or update the glyphsets tool Source: https://github.com/googlefonts/glyphsets/blob/main/README.md Use pip to install or update the glyphsets package. ```bash pip install -U glyphsets ``` -------------------------------- ### YAML Glyphset Definition Example Source: https://context7.com/googlefonts/glyphsets/llms.txt Example of a YAML file defining a glyphset, including its description, language codes, and minimal requirements for Google Fonts onboarding. ```yaml # Example: GF_Latin_Core.yaml description: "Languages of Europe and the Americas with >5M speakers, with manually curated exceptions. This set is the minimal set required for all families meant to be onboarded into Google Fonts." language_codes: - ca_Latn - cs_Latn - cy_Latn - da_Latn - de_Latn - en_Latn - es_Latn - fi_Latn - fr_Latn - hr_Latn - hu_Latn - is_Latn - it_Latn - lt_Latn - lv_Latn - mt_Latn - nb_Latn - nl_Latn - pl_Latn - pt_Latn - ro_Latn - sk_Latn - sq_Latn - sr_Latn - sv_Latn - tr_Latn ``` -------------------------------- ### Dynamic Glyphset Definition Example Source: https://context7.com/googlefonts/glyphsets/llms.txt Example of a dynamically generated glyphset definition in YAML, based on geographic regions. ```yaml # Example: GF_Latin_African.yaml (dynamically generated) regions: - DZ # Algeria - AO # Angola - BJ # Benin ``` -------------------------------- ### Install gflanguages in editable mode Source: https://github.com/googlefonts/glyphsets/blob/main/README.md Install the `gflanguages` package in editable mode to allow for real-time changes to be reflected in other tools without re-installation. This is useful when developing and modifying language definitions. ```bash pip install -e . ``` -------------------------------- ### Configure Glyphset Inheritance Source: https://context7.com/googlefonts/glyphsets/llms.txt Example of a YAML configuration file demonstrating how glyphsets can include other glyphsets to build hierarchical character coverage. This is useful for extending language support systematically. ```yaml description: "Extended Cyrillic language coverage" include_glyphsets: - GF_Latin_Kernel - GF_Cyrillic_Core language_codes: - ady_Cyrl # Adyghe - av_Cyrl # Avaric - az_Cyrl # Azerbaijani (Cyrillic) # ... more languages ``` -------------------------------- ### Find character definitions Source: https://github.com/googlefonts/glyphsets/blob/main/README.md Queries installed modules to see which languages and glyphsets include a specific character. ```bash glyphsets % glyphsets find ß ``` -------------------------------- ### Get Supported Languages per Glyphset Source: https://context7.com/googlefonts/glyphsets/llms.txt Retrieve the list of ISO 639 language codes supported by a specific glyphset. ```python from glyphsets import languages_per_glyphset # Get languages covered by GF_Latin_Core languages = languages_per_glyphset("GF_Latin_Core") print(languages) # Output: ['ca_Latn', 'cs_Latn', 'cy_Latn', 'da_Latn', 'de_Latn', 'en_Latn', # 'es_Latn', 'fi_Latn', 'fr_Latn', 'hr_Latn', 'hu_Latn', 'is_Latn', # 'it_Latn', 'lt_Latn', 'lv_Latn', 'mt_Latn', 'nb_Latn', 'nl_Latn', # 'pl_Latn', 'pt_Latn', 'ro_Latn', 'sk_Latn', 'sq_Latn', 'sr_Latn', # 'sv_Latn', 'tr_Latn'] # Get languages for Cyrillic Plus (includes more regional languages) cyrillic_langs = languages_per_glyphset("GF_Cyrillic_Plus") print(f"GF_Cyrillic_Plus supports {len(cyrillic_langs)} languages") # Output: GF_Cyrillic_Plus supports 28 languages ``` -------------------------------- ### Get Unicode Codepoints in a Glyphset Source: https://context7.com/googlefonts/glyphsets/llms.txt Retrieves a sorted list of Unicode codepoints for a specified glyphset using pre-generated .nam files. ```python from glyphsets import unicodes_per_glyphset # Get all Unicode codepoints in Latin Core unicodes = unicodes_per_glyphset("GF_Latin_Core") print(f"GF_Latin_Core has {len(unicodes)} encoded characters") # Output: GF_Latin_Core has 303 encoded characters # Show some character examples for u in unicodes[:10]: print(f"U+{u:04X}: {chr(u)}") # Output: # U+0020: # U+0021: ! # U+0022: " # U+0023: # # U+0024: $ # ... ``` -------------------------------- ### Retrieve Glyph Names in a Glyphset Source: https://context7.com/googlefonts/glyphsets/llms.txt Get a sorted list of glyph names for a specific set, with an option to return production names. ```python from glyphsets import glyphs_in_glyphset # Get all glyphs in the Latin Core set (minimum for Google Fonts onboarding) latin_core_glyphs = glyphs_in_glyphset("GF_Latin_Core") print(f"GF_Latin_Core contains {len(latin_core_glyphs)} glyphs") # Output: GF_Latin_Core contains 324 glyphs # Get glyphs with production names instead of nice names latin_core_prod = glyphs_in_glyphset("GF_Latin_Core", production_names=True) print(latin_core_prod[:5]) # Output: ['A', 'Aacute', 'Abreve', 'Acircumflex', 'Adieresis'] ``` -------------------------------- ### languages_per_glyphset - Get Languages Supported by a Glyphset Source: https://context7.com/googlefonts/glyphsets/llms.txt Returns the list of language codes that a glyphset is designed to support. Languages are defined using ISO 639 codes with script suffixes (e.g., `en_Latn` for English in Latin script). ```APIDOC ## languages_per_glyphset ### Description Returns the list of language codes that a glyphset is designed to support. ### Method Python Function Call ### Endpoint N/A (Python Library Function) ### Parameters #### Query Parameters - **glyphset_name** (string) - Required - The name of the glyphset to query. ### Request Example ```python from glyphsets import languages_per_glyphset # Get languages covered by GF_Latin_Core languages = languages_per_glyphset("GF_Latin_Core") print(languages) # Get languages for Cyrillic Plus (includes more regional languages) cyrillic_langs = languages_per_glyphset("GF_Cyrillic_Plus") print(f"GF_Cyrillic_Plus supports {len(cyrillic_langs)} languages") ``` ### Response #### Success Response (List of Strings) - **language_codes** (list) - A list of language codes (ISO 639 with script suffix). #### Response Example ```json [ "ca_Latn", "cs_Latn", "cy_Latn", "da_Latn", "de_Latn", "en_Latn", "es_Latn", "fi_Latn", "fr_Latn", "hr_Latn", "hu_Latn", "is_Latn", "it_Latn", "lt_Latn", "lv_Latn", "mt_Latn", "nb_Latn", "nl_Latn", "pl_Latn", "pt_Latn", "ro_Latn", "sk_Latn", "sq_Latn", "sr_Latn", "sv_Latn", "tr_Latn" ] ``` ``` -------------------------------- ### unicodes_per_glyphset - Get Unicode Codepoints in a Glyphset Source: https://context7.com/googlefonts/glyphsets/llms.txt Retrieves a sorted list of Unicode codepoints for all encoded characters within a specified glyphset. This function reads from pre-generated .nam files. ```APIDOC ## unicodes_per_glyphset ### Description Returns a sorted list of Unicode codepoints (as integers) for all encoded characters in a glyphset. Reads from the pre-generated .nam files. ### Method GET (conceptual, as it's a Python function call) ### Endpoint N/A (Python function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from glyphsets import unicodes_per_glyphset # Get all Unicode codepoints in Latin Core unicodes = unicodes_per_glyphset("GF_Latin_Core") print(f"GF_Latin_Core has {len(unicodes)} encoded characters") ``` ### Response #### Success Response (200) - **unicodes** (list of int) - A sorted list of Unicode codepoints. #### Response Example ```json { "unicodes": [32, 33, 34, 35, 36, ...] } ``` ``` -------------------------------- ### glyphs_in_glyphset - Get Glyph Names in a Glyphset Source: https://context7.com/googlefonts/glyphsets/llms.txt Returns a sorted list of all glyph names (nice names format) contained in a specific glyphset. This is the primary function used by external tools like fontbakery. ```APIDOC ## glyphs_in_glyphset ### Description Returns a sorted list of all glyph names contained in a specific glyphset. ### Method Python Function Call ### Endpoint N/A (Python Library Function) ### Parameters #### Query Parameters - **glyphset_name** (string) - Required - The name of the glyphset to query. - **production_names** (boolean) - Optional - If True, returns production names instead of nice names. Defaults to False. ### Request Example ```python from glyphsets import glyphs_in_glyphset # Get all glyphs in the Latin Core set (minimum for Google Fonts onboarding) latin_core_glyphs = glyphs_in_glyphset("GF_Latin_Core") print(f"GF_Latin_Core contains {len(latin_core_glyphs)} glyphs") # Get glyphs with production names instead of nice names latin_core_prod = glyphs_in_glyphset("GF_Latin_Core", production_names=True) print(latin_core_prod[:5]) ``` ### Response #### Success Response (List of Strings) - **glyph_names** (list) - A sorted list of glyph names. #### Response Example ```json [ "A", "Aacute", "Abreve", "Acircumflex", "Adieresis" ] ``` ``` -------------------------------- ### Build glyphsets Source: https://github.com/googlefonts/glyphsets/blob/main/README.md Run the build script to compile language and glyphset definitions into comprehensive lists. This command sources data from `gflanguages` and files in the `/data/definitions` folder, rendering them into various formats in the `/data/results` folder and updating the GLYPHSETS.md document. ```bash sh build.sh ``` -------------------------------- ### Generate Glyphs.app Filter List Source: https://context7.com/googlefonts/glyphsets/llms.txt Creates .plist filter files for use in Glyphs.app sidebar. Use --prod-names to use production names instead of nice names. ```bash # Create a filter list for Latin Core and Plus glyphsets filter-list -o myfilter.plist GF_Latin_Core GF_Latin_Plus # Output: # Prefixing 'CustomFilter' to out path since file is intended for Glyphsapp # Wrote CustomFiltermyfilter.plist # Use production names instead of nice names glyphsets filter-list --prod-names -o latin_filter.plist GF_Latin_Core # Create comprehensive filter for all Arabic glyphsets glyphsets filter-list -o arabic.plist GF_Arabic_Core GF_Arabic_Plus ``` -------------------------------- ### Load and Inspect Glyphset Objects Source: https://context7.com/googlefonts/glyphsets/llms.txt Use the GlyphSet factory to load definitions, access metadata, and manage caching. ```python from glyphsets import GlyphSet # Load a glyphset gs = GlyphSet.load("GF_Latin_Core") print(gs) # Output: # Access glyphset properties print(f"Script: {gs.script}") # Output: Script: Latin print(f"Description: {gs.description}") # Output: Description: Languages of Europe and the Americas with >5M speakers... # Get language codes print(f"Languages: {gs.get_language_codes()[:5]}") # Output: Languages: ['ca_Latn', 'cs_Latn', 'cy_Latn', 'da_Latn', 'de_Latn'] # Get included (inherited) glyphsets gs_plus = GlyphSet.load("GF_Cyrillic_Plus") print(f"Includes: {gs_plus.get_included_glyphsets()}") # Output: Includes: ['GF_Cyrillic_Core', 'GF_Latin_Kernel'] # Get final glyph names glyph_names = gs.get_final_glyphnames() print(f"Total glyphs: {len(glyph_names)}") # Output: Total glyphs: 324 # Force reload (clear cache) gs_fresh = GlyphSet.load("GF_Latin_Core", reload=True) ``` -------------------------------- ### Output Unicode List for Subsetting Source: https://context7.com/googlefonts/glyphsets/llms.txt Prints a formatted list of Unicode codepoints for use with font subsetting tools. Supports custom separators and decorators. ```bash # Get unicodes with default formatting (comma-separated with U+ prefix) glyphsets print-unicodes GF_Latin_Core # Output: U+0020,U+0021,U+0022,U+0023,U+0024,U+0025... # Combine multiple glyphsets glyphsets print-unicodes GF_Latin_Core GF_Latin_Vietnamese # Custom separator and decorator for different tools glyphsets print-unicodes -s " " -d "0x" GF_Latin_Kernel # Output: 0x0020 0x0021 0x0022 0x0023 0x0024... ``` -------------------------------- ### Create a custom filter list for Glyphs.app Source: https://github.com/googlefonts/glyphsets/blob/main/README.md Generates a .plist file containing specified glyphsets for use in the Glyphs.app filters sidebar. ```bash glyphsets filter-list -o myfilter.plist GF_Latin_Core GF_Latin_Plus ``` -------------------------------- ### Create Glyphs.app Filter Lists Source: https://context7.com/googlefonts/glyphsets/llms.txt Generates a .plist file for use as a Custom Filter in Glyphs.app. ```python from glyphsets import build_glyphsapp_filter_list # Create a filter list with multiple glyphsets build_glyphsapp_filter_list( glyphsets=["GF_Latin_Core", "GF_Latin_Vietnamese", "GF_Latin_Plus"], out="CustomFilter_Latin.plist", use_production_names=False # Use nice names (default) ) # Output: Wrote CustomFilter_Latin.plist ``` -------------------------------- ### build_glyphsapp_filter_list - Create Glyphs.app Filter Lists Source: https://context7.com/googlefonts/glyphsets/llms.txt Generates a .plist file compatible with Glyphs.app's Custom Filter feature, enabling designers to easily check glyph coverage in their font sources. ```APIDOC ## build_glyphsapp_filter_list ### Description Generates a .plist file that can be used as a Custom Filter in Glyphs.app, allowing designers to easily check glyph coverage in their font sources. ### Method GET (conceptual, as it's a Python function call) ### Endpoint N/A (Python function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from glyphsets import build_glyphsapp_filter_list # Create a filter list with multiple glyphsets build_glyphsapp_filter_list( glyphsets=["GF_Latin_Core", "GF_Latin_Vietnamese", "GF_Latin_Plus"], out="CustomFilter_Latin.plist", use_production_names=False # Use nice names (default) ) ``` ### Response #### Success Response (200) This function writes a .plist file to the specified output path and does not return a structured response. #### Response Example ``` Wrote CustomFilter_Latin.plist ``` ``` -------------------------------- ### defined_glyphsets - List All Available Glyphsets Source: https://context7.com/googlefonts/glyphsets/llms.txt Returns a sorted list of all glyphset names defined in the library. Each glyphset is defined in a YAML file and covers specific scripts and languages. ```APIDOC ## defined_glyphsets ### Description Returns a sorted list of all glyphset names defined in the library. ### Method Python Function Call ### Endpoint N/A (Python Library Function) ### Parameters None ### Request Example ```python from glyphsets import defined_glyphsets glyphsets = defined_glyphsets() print(glyphsets) ``` ### Response #### Success Response (List of Strings) - **glyphsets** (list) - A sorted list of glyphset names. #### Response Example ```json [ "GF_Arabic_Core", "GF_Arabic_Plus", "GF_Cyrillic_Core", "GF_Cyrillic_Historical", "GF_Cyrillic_Plus", "GF_Cyrillic_Pro", "GF_Greek_AncientMusicalSymbols", "GF_Greek_Archaic", "GF_Greek_Coptic", "GF_Greek_Core", "GF_Greek_Expert", "GF_Greek_Plus", "GF_Greek_Pro", "GF_Latin_African", "GF_Latin_Beyond", "GF_Latin_Core", "GF_Latin_Kernel", "GF_Latin_Plus", "GF_Latin_PriAfrican", "GF_Latin_Vietnamese", "GF_Phonetics_APA", "GF_Phonetics_DisorderedSpeech", "GF_Phonetics_IPAHistorical", "GF_Phonetics_IPAStandard", "GF_Phonetics_SinoExt", "GF_TransLatin_Arabic", "GF_TransLatin_Pinyin" ] ``` ``` -------------------------------- ### Compare Glyphsets Source: https://context7.com/googlefonts/glyphsets/llms.txt Compares the contents of multiple glyphsets, showing differences between each consecutive pair. Useful for understanding hierarchical relationships between glyphsets. ```bash # Compare glyphset hierarchy glyphsets compare GF_Latin_Kernel GF_Latin_Core # Output: # ============ GF_Latin_Kernel ============ # Total glyphs: 116 # # Letter (52 glyphs): # A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c d e f g h i j k l m n o p q r s t u v w x y z # ... # # ============ GF_Latin_Core ============ # Total glyphs: 324 # # GF_Latin_Core has 208 additional glyphs compared to GF_Latin_Kernel: # # Letter (168 glyphs): # ª º À Á Â Ã Ä Å Æ Ç È É Ê Ë... # Compare multiple sets in sequence glyphsets compare GF_Cyrillic_Core GF_Cyrillic_Plus GF_Cyrillic_Pro ``` -------------------------------- ### Print Detailed Font Analysis Source: https://context7.com/googlefonts/glyphsets/llms.txt Outputs a formatted console report categorizing glyphset support levels for a font. ```python from fontTools.ttLib import TTFont from glyphsets import analyze_font # Load and analyze a font font = TTFont("path/to/your/font.ttf") analyze_font(font) # Output (printed to console with colors): # ============ Fully supported glyphsets: ============ # GF_Latin_Kernel 100% # GF_Latin_Core 100% # # ============ Partially supported glyphsets (>80%): ============ # GF_Latin_Vietnamese 95% (Not part of shape_languages because of missing language definitions) # Missing: Ắ Ằ Ẳ Ẵ Ặ # # ============ Unsupported glyphsets (<80%): ============ # GF_Greek_Core 45% # Missing: Ά Έ Ή Ί Ό Ύ Ώ... ``` -------------------------------- ### Print Unicodes for Subsetting Source: https://github.com/googlefonts/glyphsets/blob/main/CHANGELOG.md Use the print-unicodes command to pipe character lists directly into subsetting tools like pyftsubset. ```bash pyftsubset font.ttf --unicodes=$(glyphsets print-unicodes GF_Latin_Core GF_Cyrillic_Core) ``` -------------------------------- ### Analyze Font Glyphset Coverage Source: https://context7.com/googlefonts/glyphsets/llms.txt Analyzes which glyphsets a font binary supports and shows missing characters for partially supported sets. Helps identify gaps in font coverage. ```bash # Analyze a font file glyphsets coverage path/to/font.ttf # Output: # ============ Fully supported glyphsets: ============ # GF_Latin_Kernel 100% # GF_Latin_Core 100% # # ============ Partially supported glyphsets (>80%): ============ # GF_Latin_Vietnamese 95% # Missing: Ắ Ằ Ẳ Ẵ # # ============ Unsupported glyphsets (<80%): ============ # GF_Greek_Core 12% # Missing: Ά Έ Ή Ί Ό Ύ Ώ... ``` -------------------------------- ### Glyphset Configuration Options Source: https://context7.com/googlefonts/glyphsets/llms.txt Configuration options for defining glyphsets, including minimum speaker population, inclusion of auxiliary characters, and exclusion of specific language codes. This helps in tailoring the glyphset requirements. ```yaml population: 1 # Minimum speaker population use_auxiliary: true # Include auxiliary characters from gflanguages historical: false # Exclude historical languages exclude_language_codes: - en_Latn # Exclude English (covered elsewhere) - fr_Latn # Exclude French - de_Latn # Exclude German - pt_Latn # Exclude Portuguese - es_Latn # Exclude Spanish ``` -------------------------------- ### Compare glyphsets Source: https://github.com/googlefonts/glyphsets/blob/main/README.md Compares the contents of multiple glyphsets, listing extra or missing glyphs relative to the previous set. ```bash glyphsets compare GF_Latin_Kernel GF_Latin_Core ``` -------------------------------- ### List Available Glyphsets Source: https://context7.com/googlefonts/glyphsets/llms.txt Retrieve a sorted list of all available glyphset names defined in the library. ```python from glyphsets import defined_glyphsets # Get all available glyphset names glyphsets = defined_glyphsets() print(glyphsets) # Output: ['GF_Arabic_Core', 'GF_Arabic_Plus', 'GF_Cyrillic_Core', 'GF_Cyrillic_Historical', # 'GF_Cyrillic_Plus', 'GF_Cyrillic_Pro', 'GF_Greek_AncientMusicalSymbols', # 'GF_Greek_Archaic', 'GF_Greek_Coptic', 'GF_Greek_Core', 'GF_Greek_Expert', # 'GF_Greek_Plus', 'GF_Greek_Pro', 'GF_Latin_African', 'GF_Latin_Beyond', # 'GF_Latin_Core', 'GF_Latin_Kernel', 'GF_Latin_Plus', 'GF_Latin_PriAfrican', # 'GF_Latin_Vietnamese', 'GF_Phonetics_APA', 'GF_Phonetics_DisorderedSpeech', # 'GF_Phonetics_IPAHistorical', 'GF_Phonetics_IPAStandard', 'GF_Phonetics_SinoExt', # 'GF_TransLatin_Arabic', 'GF_TransLatin_Pinyin'] ``` -------------------------------- ### compare_glyphsets - Compare Multiple Glyphsets Source: https://context7.com/googlefonts/glyphsets/llms.txt Compares the contents of multiple glyphsets, highlighting additional and missing glyphs between consecutive sets in the provided list. ```APIDOC ## compare_glyphsets ### Description Compares the contents of two or more glyphsets, showing what glyphs are extra or missing between consecutive glyphsets. ### Method GET (conceptual, as it's a Python function call) ### Endpoint N/A (Python function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from glyphsets import compare_glyphsets # Compare glyphset hierarchy (each compared to previous) compare_glyphsets(["GF_Latin_Kernel", "GF_Latin_Core", "GF_Latin_Vietnamese"]) ``` ### Response #### Success Response (200) This function prints comparison details to the console and does not return a structured response. #### Response Example ``` ============ GF_Latin_Kernel ============ Total glyphs: 116 Letter (52 glyphs): A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c... Number (10 glyphs): 0 1 2 3 4 5 6 7 8 9 ... ============ GF_Latin_Core ============ Total glyphs: 324 GF_Latin_Core has 208 additional glyphs compared to GF_Latin_Kernel: Letter (168 glyphs): ª º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø... ... ``` ``` -------------------------------- ### Python Script for Glyphset Filter List Source: https://context7.com/googlefonts/glyphsets/llms.txt Python script to generate a .plist filter file for Glyphs.app. Use production names for UFO workflows. ```python build_glyphsapp_filter_list( glyphsets=["GF_Greek_Core", "GF_Greek_Plus"], out="CustomFilterGreek.plist", use_production_names=True ) # Output: Prefixing 'CustomFilter' to out path since file is intended for Glyphsapp # Wrote CustomFilterGreek.plist ``` -------------------------------- ### Analyze Font Coverage Source: https://context7.com/googlefonts/glyphsets/llms.txt Determines the extent of glyphset support in a font file, returning coverage percentages and missing glyphs. ```python from fontTools.ttLib import TTFont from glyphsets import get_glyphsets_fulfilled # Load a font file font = TTFont("path/to/your/font.ttf") # Analyze glyphset coverage results = get_glyphsets_fulfilled(font) # Results are sorted by percentage (highest first) for glyphset_name, data in list(results.items())[:5]: percentage = data["percentage"] * 100 missing_count = len(data["missing"]) print(f"{glyphset_name}: {percentage:.1f}% ({missing_count} missing)") # Output example: # GF_Latin_Kernel: 100.0% (0 missing) # GF_Latin_Core: 100.0% (0 missing) # GF_Latin_Vietnamese: 95.2% (9 missing) # GF_Latin_PriAfrican: 87.5% (16 missing) # GF_Greek_Core: 45.3% (114 missing) # Get details on what's missing latin_viet = results["GF_Latin_Vietnamese"] print(f"Missing characters: {[chr(u) for u in latin_viet['missing'][:5]]}") # Output: Missing characters: ['Ắ', 'Ằ', 'Ẳ', 'Ẵ', 'Ặ'] ``` -------------------------------- ### Compare Multiple Glyphsets Source: https://context7.com/googlefonts/glyphsets/llms.txt Displays differences between consecutive glyphsets in a provided list. ```python from glyphsets import compare_glyphsets # Compare glyphset hierarchy (each compared to previous) compare_glyphsets(["GF_Latin_Kernel", "GF_Latin_Core", "GF_Latin_Vietnamese"]) # Output (printed to console with colors): # ============ GF_Latin_Kernel ============ # Total glyphs: 116 # # Letter (52 glyphs): A B C D E F G H I J K L M N O P Q R S T U V W X Y Z a b c... # Number (10 glyphs): 0 1 2 3 4 5 6 7 8 9 # ... # # ============ GF_Latin_Core ============ # Total glyphs: 324 # # GF_Latin_Core has 208 additional glyphs compared to GF_Latin_Kernel: # # Letter (168 glyphs): ª º À Á Â Ã Ä Å Æ Ç È É Ê Ë Ì Í Î Ï Ð Ñ Ò Ó Ô Õ Ö Ø... # ... ``` -------------------------------- ### GlyphSet.load - Load a Glyphset Object Source: https://context7.com/googlefonts/glyphsets/llms.txt Factory method to load a glyphset by name with caching. The GlyphSet class provides detailed access to glyphset definitions, included glyphsets, characters, and more. ```APIDOC ## GlyphSet.load ### Description Factory method to load a glyphset by name with caching. The GlyphSet class provides detailed access to glyphset definitions, included glyphsets, characters, and more. ### Method Python Class Method ### Endpoint N/A (Python Library Function) ### Parameters #### Path Parameters - **glyphset_name** (string) - Required - The name of the glyphset to load. #### Query Parameters - **reload** (boolean) - Optional - If True, clears the cache and reloads the glyphset. Defaults to False. ### Request Example ```python from glyphsets import GlyphSet # Load a glyphset gs = GlyphSet.load("GF_Latin_Core") print(gs) # Access glyphset properties print(f"Script: {gs.script}") print(f"Description: {gs.description}") # Get language codes print(f"Languages: {gs.get_language_codes()[:5]}") # Get included (inherited) glyphsets gs_plus = GlyphSet.load("GF_Cyrillic_Plus") print(f"Includes: {gs_plus.get_included_glyphsets()}") # Get final glyph names glyph_names = gs.get_final_glyphnames() print(f"Total glyphs: {len(glyph_names)}") # Force reload (clear cache) gs_fresh = GlyphSet.load("GF_Latin_Core", reload=True) ``` ### Response #### Success Response (GlyphSet Object) - **GlyphSet Object** - An object representing the loaded glyphset with properties like `script`, `description`, `get_language_codes()`, `get_included_glyphsets()`, and `get_final_glyphnames()`. #### Response Example ```json { "script": "Latin", "description": "Languages of Europe and the Americas with >5M speakers...", "languages": [ "ca_Latn", "cs_Latn", "cy_Latn", "da_Latn", "de_Latn" ], "includes": [ "GF_Cyrillic_Core", "GF_Latin_Kernel" ], "total_glyphs": 324 } ``` ``` -------------------------------- ### glyphsets compare Source: https://context7.com/googlefonts/glyphsets/llms.txt Compares the contents of multiple glyphsets to identify differences between consecutive pairs. ```APIDOC ## CLI COMMAND: glyphsets compare ### Description Compares the contents of multiple glyphsets, showing differences between each consecutive pair. ### Parameters #### Arguments - **glyphsets** (list) - Required - Sequence of glyphset names to compare. ### Request Example ```bash glyphsets compare GF_Latin_Kernel GF_Latin_Core ``` ``` -------------------------------- ### glyphsets print-unicodes Source: https://context7.com/googlefonts/glyphsets/llms.txt Outputs a formatted list of Unicode codepoints for font subsetting tools. ```APIDOC ## CLI COMMAND: glyphsets print-unicodes ### Description Prints a formatted list of Unicode codepoints for use with font subsetting tools. ### Parameters #### Options - **-s, --separator** (string) - Optional - Custom separator for the output list. - **-d, --decorator** (string) - Optional - Custom decorator for the output list. #### Arguments - **glyphsets** (list) - Required - List of glyphsets to process. ### Request Example ```bash glyphsets print-unicodes -s " " -d "0x" GF_Latin_Kernel ``` ``` -------------------------------- ### get_glyphsets_fulfilled - Analyze Font Coverage Source: https://context7.com/googlefonts/glyphsets/llms.txt Analyzes a given font file to determine its support level for various glyphsets, providing percentages, present glyphs, and missing glyphs for each. ```APIDOC ## get_glyphsets_fulfilled ### Description Analyzes a font file to determine which glyphsets it fully or partially supports. Returns a dictionary with coverage percentages, present and missing glyphs for each glyphset. ### Method GET (conceptual, as it's a Python function call) ### Endpoint N/A (Python function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from fontTools.ttLib import TTFont from glyphsets import get_glyphsets_fulfilled # Load a font file font = TTFont("path/to/your/font.ttf") # Analyze glyphset coverage results = get_glyphsets_fulfilled(font) # Results are sorted by percentage (highest first) for glyphset_name, data in list(results.items())[:5]: percentage = data["percentage"] * 100 missing_count = len(data["missing"]) print(f"{glyphset_name}: {percentage:.1f}% ({missing_count} missing)") ``` ### Response #### Success Response (200) - **results** (dict) - A dictionary where keys are glyphset names and values are dictionaries containing: - **percentage** (float) - The coverage percentage (0.0 to 1.0). - **present** (list of int) - List of Unicode codepoints present. - **missing** (list of int) - List of Unicode codepoints missing. #### Response Example ```json { "GF_Latin_Kernel": { "percentage": 1.0, "present": [32, 33, ...], "missing": [] }, "GF_Latin_Core": { "percentage": 1.0, "present": [32, 33, ...], "missing": [] }, "GF_Latin_Vietnamese": { "percentage": 0.952, "present": [32, 33, ...], "missing": [7840, 7842, 7844, 7846, 7848, ...] } } ``` ``` -------------------------------- ### glyphsets filter-list Source: https://context7.com/googlefonts/glyphsets/llms.txt Generates .plist filter files for use in the Glyphs.app sidebar to manage glyph coverage. ```APIDOC ## CLI COMMAND: glyphsets filter-list ### Description Creates .plist filter files for use in Glyphs.app sidebar, making it easy to check glyph coverage while designing fonts. ### Parameters #### Options - **-o, --out** (string) - Required - Output path for the .plist file. - **--prod-names** (flag) - Optional - Use production names instead of nice names. #### Arguments - **glyphsets** (list) - Required - List of glyphset names to include. ### Request Example ```bash glyphsets filter-list -o myfilter.plist GF_Latin_Core GF_Latin_Plus ``` ``` -------------------------------- ### Find Character in Definitions Source: https://context7.com/googlefonts/glyphsets/llms.txt Searches for character usage across languages and glyphsets, accepting either characters or Unicode codepoints. ```python from glyphsets import find_character # Find where the German sharp S (ß) is defined find_character("ß") # Output: # Character: [ß] (0x00DF LATIN SMALL LETTER SHARP S) # # Language Name Category Speakers Script Regions # ---------- ------------- ---------- ---------- -------- --------------------------------------- # fr_Latn French auxiliary 272965534 Latn Asia, Americas, Oceania, Europe, Africa # de_Latn German base 134799567 Latn Asia, Americas, Europe, Africa # tr_Latn Turkish auxiliary 80191488 Latn Europe, Asia # ... # # Character is part of the following glyphsets: # --------------------------------------------- # GF_Latin_Core # Search by Unicode codepoint find_character("0x00DF") # Same result as above ``` -------------------------------- ### Find Character Definitions Source: https://context7.com/googlefonts/glyphsets/llms.txt Locates where a specific character is defined across languages and glyphsets. Can search by character or Unicode codepoint. ```bash # Find by character glyphsets find ß # Output: # Character: [ß] (0x00DF LATIN SMALL LETTER SHARP S) # # Language Name Category Speakers Script Regions # ---------- ------------- ---------- ---------- -------- --------- # de_Latn German base 134799567 Latn Europe # ... # # Character is part of the following glyphsets: # --------------------------------------------- # GF_Latin_Core # Find by Unicode codepoint (hex) glyphsets find 0x017F # Output: # Character: [ſ] (0x017F LATIN SMALL LETTER LONG S) # ... ``` -------------------------------- ### glyphsets coverage Source: https://context7.com/googlefonts/glyphsets/llms.txt Analyzes a font binary to determine which glyphsets it supports and identifies missing characters. ```APIDOC ## CLI COMMAND: glyphsets coverage ### Description Analyzes which glyphsets a font binary supports and shows missing characters for partially supported sets. ### Parameters #### Arguments - **font_path** (string) - Required - Path to the font file (e.g., .ttf). ### Request Example ```bash glyphsets coverage path/to/font.ttf ``` ``` -------------------------------- ### glyphsets find Source: https://context7.com/googlefonts/glyphsets/llms.txt Locates character definitions across languages and glyphsets. ```APIDOC ## CLI COMMAND: glyphsets find ### Description Locates where a specific character is defined across languages and glyphsets. ### Parameters #### Arguments - **character/codepoint** (string) - Required - The character or hex codepoint to search for. ### Request Example ```bash glyphsets find ß ``` ``` -------------------------------- ### analyze_font - Print Detailed Font Analysis Source: https://context7.com/googlefonts/glyphsets/llms.txt Provides a detailed analysis of a font's support for various glyphsets, categorizing them into fully supported, partially supported, and unsupported. ```APIDOC ## analyze_font ### Description Prints a comprehensive analysis of which glyphsets a font supports, grouped by full support, partial support (>80%), and unsupported (<80%). ### Method GET (conceptual, as it's a Python function call) ### Endpoint N/A (Python function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from fontTools.ttLib import TTFont from glyphsets import analyze_font # Load and analyze a font font = TTFont("path/to/your/font.ttf") analyze_font(font) ``` ### Response #### Success Response (200) This function prints output directly to the console and does not return a structured response. #### Response Example ``` ============ Fully supported glyphsets: ============ GF_Latin_Kernel 100% GF_Latin_Core 100% ============ Partially supported glyphsets (>80%): ============ GF_Latin_Vietnamese 95% (Not part of shape_languages because of missing language definitions) Missing: Ắ Ằ Ẳ Ẵ Ặ ============ Unsupported glyphsets (<80%): ============ GF_Greek_Core 45% Missing: Ά Έ Ή Ί Ό Ύ Ώ... ``` ``` -------------------------------- ### find_character - Find Character in Definitions Source: https://context7.com/googlefonts/glyphsets/llms.txt Searches for a specific character across all language definitions and glyphsets, indicating which languages use it and in what category. ```APIDOC ## find_character ### Description Searches for a specific character across all language definitions and glyphsets, showing which languages use it and in what category. ### Method GET (conceptual, as it's a Python function call) ### Endpoint N/A (Python function) ### Parameters #### Path Parameters None #### Query Parameters None #### Request Body None ### Request Example ```python from glyphsets import find_character # Find where the German sharp S (ß) is defined find_character("ß") # Search by Unicode codepoint find_character("0x00DF") ``` ### Response #### Success Response (200) This function prints detailed information about the character's usage to the console and does not return a structured response. #### Response Example ``` Character: [ß] (0x00DF LATIN SMALL LETTER SHARP S) Language Name Category Speakers Script Regions ---------- ------------- ---------- ---------- -------- --------------------------------------- fr_Latn French auxiliary 272965534 Latn Asia, Americas, Oceania, Europe, Africa de_Latn German base 134799567 Latn Asia, Americas, Europe, Africa tr_Latn Turkish auxiliary 80191488 Latn Europe, Asia ... Character is part of the following glyphsets: --------------------------------------------- GF_Latin_Core ``` ``` === COMPLETE CONTENT === This response contains all available snippets from this library. No additional content exists. Do not make further requests.