Repository navigation
Conversation
No manifest permission granted zgx's Capability::Fonts, so every plugin window's ui.load_font was refused, and a window couldn't measure in the fonts its service loads with zeron.load_font. A loaded font reaches every window's text, Zeron's own included, so the person is asked.
Contributor
Author
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
No plugin can use
ui.load_font(zeronsh/zgx#2074). zgx asks the host to grantCapability::Fonts, and no manifest permission maps to it, so every call is refused with "a plugin does this only if the host grants it". A plugin's service can already load a font file withzeron.load_font(#1367), and its window can't load the same file to measure and draw alike.Now a manifest can ask for
"fonts", which grantsCapability::Fontsto the plugin's windows.zeron.load_fontstill needs no permission, because those fonts stay in that plugin's own service.apps/zgx/docs/plugins.md.This needs a zgx with #2074:
Capability::Fontsdoesn't exist at the revapps/zgxpins today (06c6d56). Merge it with the bump that brings #2074 in.Testing
grants.rsfonts_lets_its_windows_load_font_files:"fonts"grantsCapability::Fonts, and other permissions don't. I ran it with the other grants tests against zgx-script at06c6d56with #2074's commit on top: 3 passed. I couldn't build the whole app on this Windows machine because mimalloc's C build fails here, independent of this change, so the app's i18n and consent tests didn't run.manifest.rsa_plugin_may_ask_for_fonts: a manifest asking for"fonts"isn't broken.cargo test -p zeron-engine --lib manifest: 8 passed.Open question
I didn't mark the permission as risky in the consent sheet. Changing how Zeron's own text looks could be used to make text look different from what it is. Should it be flagged risky?
Open in [code]smith · Need help on this PR? Tag
@codesmith-botwith what you need.