As we've discussed offline, the command_queue.hpp is the api that we want to move towards.
However, I'm not sure how this CommandQueue::addGlobalFontAsset(std::string name, FontHandle handle) should work for fonts.
In my use case, I have two use cases.
- out-of-band/referenced fonts
- font fallbacks
If it's already possible, can you provide examples of how to do this?
- After loading a
.riv, the user wants to swap one font in the FileHandle.
- After loading a
.riv file, and setting a localised text, the text uses glyphs that aren't present in the default font. Adding one or more font fallbacks is needed.
Suggestions:
-
Add CommandQueue::addFont(FileHandle file, std::string name, FontHandle handle, uint64_t requestId = 0) - Replaces the font asset with name with a new font.
-
Add CommandQueue::removeFont(FileHandle file, std::string name, FontHandle handle, uint64_t requestId = 0) - Removed the font asset with name with a new font. Leaves it empty, as one has to be able to explicitly control memory usage.
-
Add CommandQueue::addFontFallback(FontHandle font, FontHandle fallback, uint64_t requestId = 0) -- adds a font fallback (e.g. japanese) to an existing font
-
Add CommandQueue::removeFontFallback(FontHandle font, FontHandle fallback, uint64_t requestId = 0) -- removes a font fallback from an existing font
As we've discussed offline, the
command_queue.hppis the api that we want to move towards.However, I'm not sure how this
CommandQueue::addGlobalFontAsset(std::string name, FontHandle handle)should work for fonts.In my use case, I have two use cases.
If it's already possible, can you provide examples of how to do this?
.riv, the user wants to swap one font in theFileHandle..rivfile, and setting a localised text, the text uses glyphs that aren't present in the default font. Adding one or more font fallbacks is needed.Suggestions:
Add
CommandQueue::addFont(FileHandle file, std::string name, FontHandle handle, uint64_t requestId = 0)- Replaces the font asset withnamewith a new font.Add
CommandQueue::removeFont(FileHandle file, std::string name, FontHandle handle, uint64_t requestId = 0)- Removed the font asset withnamewith a new font. Leaves it empty, as one has to be able to explicitly control memory usage.Add
CommandQueue::addFontFallback(FontHandle font, FontHandle fallback, uint64_t requestId = 0)-- adds a font fallback (e.g. japanese) to an existing fontAdd
CommandQueue::removeFontFallback(FontHandle font, FontHandle fallback, uint64_t requestId = 0)-- removes a font fallback from an existing font