feat: add support for kitty's font size protocol#438
Merged
mfontanini merged 1 commit intomasterfrom Feb 6, 2025
Merged
Conversation
Owner
Author
|
If someone uses this kitty >= 0.40.0 and feel like the default themes around this look odd please comment here! |
mfontanini
added a commit
that referenced
this pull request
Feb 16, 2025
This extends the font size capabilities introduced in #438 by allowing the user to specify the font size in the form of a comment command anywhere in the presentation. This command changes the size of the font for the remainder of the slide. Currently this doesn't work in cases like executable snippets, but I'll fix that when I have more time. Example presentation: ~~~markdown test > this is > small <!-- font_size: 2 --> test > this is > large ```rust fn greet() -> &'static str { "hi mom" } ``` ~~~ 
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.
This adds support for kitty's font size protocol (kovidgoyal/kitty#8226) which allows printing characters that take up more than one cell. This feature will be available in kitty >= 0.40.0 and is currently only available in nightly builds.
This for now is only supported in a subset of the theme components, namely:
intro_slide.title.font_size).slide_title.font_size).headings.h*.font_size).Font sizes are only used if the terminal emulator supports it so this doesn't change anything for emulators other than kitty (or other implementors of the protocol). If you find this somehow breaks something, please create an issue.
For now all built in themes set
intro_slide.title.font_size=2andslide_title.font_size=2. I think this looks a lot better this way but please do comment here if you don't think built in themes should come with these values set.These are now the first 2 slides in the
demo.mdexample:simplescreenrecorder-2025-02-05_06.33.10.mp4