Skip to content

feat: add support for kitty's font size protocol#438

Merged
mfontanini merged 1 commit intomasterfrom
feat/font-size
Feb 6, 2025
Merged

feat: add support for kitty's font size protocol#438
mfontanini merged 1 commit intomasterfrom
feat/font-size

Conversation

@mfontanini
Copy link
Owner

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:

  • The introduction slide's presentation title (intro_slide.title.font_size).
  • The slide titles (slide_title.font_size).
  • The headings (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=2 and slide_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.md example:

simplescreenrecorder-2025-02-05_06.33.10.mp4

@mfontanini mfontanini changed the title feat: add support for kitty's font size spec feat: add support for kitty's font size protocol Feb 5, 2025
@mfontanini
Copy link
Owner Author

If someone uses this kitty >= 0.40.0 and feel like the default themes around this look odd please comment here!

@mfontanini mfontanini merged commit fb0223b into master Feb 6, 2025
4 checks passed
@mfontanini mfontanini deleted the feat/font-size branch February 6, 2025 00:20
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"
}
```
~~~


![image](https://github.com/user-attachments/assets/91b88b57-edd7-47b6-8b47-b5fa6ea3575e)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant