feat: self-host MapLibre font glyphs with OpenSans#144
Conversation
Replace external MapTiler API dependency for font glyphs with self-hosted OpenSans PBF files generated from TTF sources. - Generate SDF glyph PBFs (OpenSans-Regular, Bold, SemiBold) via build_pbf_glyphs and add to assets/fonts/ - Add /images/maps/fonts/:fontstack/:range endpoint to serve PBFs - Add configurable fonts directory (default: assets/fonts, env: OCAP_FONTS) - Update style generation to use relative glyphs URL and OpenSans fonts - Remove hardcoded MapTiler API key from glyphs URL
Merging this branch will decrease overall coverage
Coverage by fileChanged files (no unit tests)
Please note that the "Total", "Covered", and "Missed" counts above refer to code statements instead of lines of code. The value in brackets refers to the test coverage of that file in the old version of the code. Changed unit test files
|
Summary of ChangesHello @fank, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request significantly enhances the mapping infrastructure by transitioning from an external font glyph service to a self-hosted solution using OpenSans fonts. This change improves autonomy, reduces reliance on third-party APIs, and provides greater control over font assets used in MapLibre styles. The update involves adding the necessary font files and configuring the system to serve them locally, ensuring consistent and reliable font rendering for map labels. Highlights
Changelog
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request successfully migrates the MapLibre font glyphs from an external MapTiler API dependency to self-hosted OpenSans SDF PBF files. The addition of numerous PBF files for OpenSans Bold and Regular font styles, along with the necessary endpoint and style generation updates, aligns well with the stated goals. The changes improve self-sufficiency and remove a hardcoded API key dependency, which is a positive step for maintainability and security. The test plan outlined in the description covers the essential verification steps.
Summary
build_pbf_glyphs/images/maps/fonts/:fontstack/:rangeendpoint with configurable font directory (OCAP_FONTS, defaultassets/fonts)Test plan
/images/maps/fonts/OpenSans-Regular/0-255.pbf