Skip to content
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

GRAPHICS: MACGUI: TTF support in Markdown #5658

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

InariInDream
Copy link

Add support for ttf file in markdown

I used "GoMono-Regular.ttf" in this case.

image

@sev- sev- marked this pull request as draft February 12, 2024 14:53
@InariInDream InariInDream marked this pull request as ready for review February 14, 2024 07:17
@InariInDream InariInDream force-pushed the markdwon-add-support-for-ttf-fonts branch 4 times, most recently from 84495ee to ed05493 Compare February 14, 2024 16:58
Copy link
Member

@sev- sev- left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I added a few notes

gui/widgets/richtext.cpp Outdated Show resolved Hide resolved
graphics/macgui/macfontmanager.cpp Outdated Show resolved Hide resolved
graphics/macgui/macfontmanager.cpp Outdated Show resolved Hide resolved
graphics/macgui/macfontmanager.cpp Outdated Show resolved Hide resolved
graphics/macgui/macfontmanager.h Outdated Show resolved Hide resolved
@@ -516,6 +516,11 @@ const Font *MacFontManager::getFont(MacFont *macFont) {
font = Graphics::loadTTFFontFromArchive("FreeSans.ttf", macFont->getSize(), Graphics::kTTFSizeModeCharacter, 0, 0, Graphics::kTTFRenderModeMonochrome);
_uniFonts[macFont->getSize()] = font;
}
} else {
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It is not clear to me why it is in the non-Unicode branch. Also, what does happen if there is no font registered? I see no return value checking.

@InariInDream InariInDream force-pushed the markdwon-add-support-for-ttf-fonts branch 2 times, most recently from 8cd5c5e to 4e424da Compare February 23, 2024 13:20
@InariInDream InariInDream force-pushed the markdwon-add-support-for-ttf-fonts branch from 0b26bba to a4e5372 Compare February 26, 2024 04:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants