code-syntax-addon / code-syntax

Syntax Highlighting Add-on for Google Apps
MIT License
16 stars 4 forks source link

Adjusting font? #4

Closed AirHeadsbuirse closed 2 years ago

AirHeadsbuirse commented 2 years ago

Is there a way to change what font the code is auto adjusted to on colorize?

floitsch commented 2 years ago

Not at the moment. The font is hardcoded into the sources: https://github.com/floitsch/syntax-addon/blob/master/theme/theme.ts#L88

floitsch commented 2 years ago

Theme support would solve this, so I'm closing this issue as a duplicate of #3.

tilleul commented 6 months ago

If it's only for the Font support, maybe it could be done in a simpler (?) way, or at least a way that does not require you to support themes (which seems like a lot of work): simply don't replace the initial font of the code when formatting/highlighting code. That way the user is in charge of the font. Would that be easier ?

floitsch commented 6 months ago

Typically, blocks want to be rendered with a fixed-width font, whereas the default of a document is typically variable width. Leaving the font unchanged is thus not really an option...

That said: as you said, adding theme support is significant work, and I don't have the capacity to do that anytime soon. So I'm open for an easy fix/work-around.

tilleul commented 6 months ago

imho, it is a viable option: let the user decide what font they want. If they didn't change the font to a monospace font, they'll see it soon enough and simply select the code and modify the font, then all subsequent "colorize" command will just use that font they selected. Just mention this in the docs and you're done (or so to speak, I know it's easier said than done)