-
Notifications
You must be signed in to change notification settings - Fork 2.2k
rendfont.cpp,rendlay.cpp: add font support to <text> components
#14533
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Open
cbrunschen
wants to merge
8
commits into
mamedev:master
Choose a base branch
from
cbrunschen:layout_text_font
base: master
Could not load branches
Branch not found: {{ refName }}
Loading
Could not load tags
Nothing to show
Loading
Are you sure you want to change the base?
Some commits from the old base branch may be removed from the timeline,
and old review comments may become outdated.
+1,221
−1,051
Conversation
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
… support to `<text>` components This adds a "font" attribute to the `<text>` layout component, defaulting to `"default"` if nothing is specified. It also changes the `render_font` constructor to accept not just a single "filename" but a comma-separated list of "filenames". These actually don't seem to be file names at all, but font specifications that may be symbolic (like the default `"Liberation Sans|Regular"` in `font_osd.cpp`), which includes a `|` separator between font family and style. This is in turn used in the Ensoniq VFX family of keyboards to use the ccorrect Bold and Italic styles of a suitable Helvetica-compatible sans-serif font, falling back to "default" of nothing is found. This includes a first choice of an explicitly nonexistent font to demonstrate that the list of fonts is in fact traversed.
…le" type font names.
…me. Instead, just like in the other OS versions, separate out the '|'-separated style information, extract bold/italic styling information from that into a CTFontSymbolicTraits, and then use CTFontDescriptorCreateCopyWithSymbolicTraits to apply those, if any are requested.
Contributor
Author
30b58ac to
af23e44
Compare
af23e44 to
38ab52e
Compare
Contributor
Author
<text> components<text> components
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.





For discussion: improves the layout
<text>component to allow specifying the font and style to use, with fairly minimal changes to the layout rendering system.This adds a "font" attribute to the
<text>layout component, defaulting to"default"if nothing is specified.It also changes the
render_fontconstructor to accept not just a single "filename" but a comma-separated list of "filenames". These actually don't seem to be file names at all, but font specifications that may be symbolic (like the default"Liberation Sans|Regular"infont_osd.cpp), which includes a|separator between font family and style; so adding another separator between different font specifications seems a not unreasonable thing, but is of course open to be changed.This is in turn used in the layouts for the Ensoniq VFX family of keyboards, including the
sd132, to use the correct Bold, Italic and Regular styles of a suitable Helvetica-compatible sans-serif font, falling back to "default" of nothing else is found. This includes a first choice of an explicitly nonexistent font to demonstrate that the list of fonts is in fact traversed.The labels along the thick coloured line - including 'Performance', 'Sequencer' and 'Programming' - are all in Bold; the labels above the buttons - 'Volume', 'Pan', 'Timbre', etc - are all Italic; and the extra little labels between white lines, 'Tracks' and 'Edit', are in Regular style (neither Bold nor Italic).