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

Ligature support #85

Open
bts opened this issue Nov 18, 2018 · 4 comments
Open

Ligature support #85

bts opened this issue Nov 18, 2018 · 4 comments
Labels
help wanted Extra attention is needed

Comments

@bts
Copy link
Contributor

bts commented Nov 18, 2018

Thanks for this project! What would be necessary for us to add ligature support to termonad? e.g. for the font PragmataPro

@cdepillabout cdepillabout added help wanted Extra attention is needed beginner-friendly Good for newcomers labels Nov 19, 2018
@cdepillabout
Copy link
Owner

@bts I'm not very familiar with ligature support, or how it is handled in the Gnome ecosystem.

Termonad is using the VTE library, which is a terminal emulator from the Gnome team exposed as a GTK widget.

The Terminal from the VTE library exposes a method to set a FontDescription for the terminal:

https://hackage.haskell.org/package/gi-vte-2.91.19/docs/GI-Vte-Objects-Terminal.html#g:87

This method is called by Termonad when creating a new Terminal:

terminalSetFont vteTerm (Just tmStateFontDesc)

The FontDescription in question is created here:

createFontDesc :: TMConfig -> IO FontDescription
createFontDesc tmConfig = do
fontDesc <- fontDescriptionNew
let fontConf = tmConfig ^. lensOptions . lensFontConfig
fontDescriptionSetFamily fontDesc (fontFamily fontConf)
case fontSize fontConf of
FontSizePoints points ->
fontDescriptionSetSize fontDesc $ fromIntegral (points * fromIntegral SCALE)
FontSizeUnits units ->
fontDescriptionSetAbsoluteSize fontDesc $ units * fromIntegral SCALE
pure fontDesc

A FontDescription itself is defined in the pango library. I think pango is the Gnome library dealing with fonts:

https://hackage.haskell.org/package/gi-pango-1.0.16/docs/GI-Pango-Structs-FontDescription.html#t:FontDescription


I'm not sure if adding ligature support would be an option to pass to the FontDescription when creating it, or if it is an option that would have to be set on the Terminal itself (or the underlying widget?). It is also possible that ligature support is a feature that is not supported in VTE. (In that case I would suggest creating an issue on the VTE issue tracker.)

If you wanted to spend some time to look into this, I would suggest the following:

  • Read through the documentation for gi-vte, gi-gtk, and gi-pango trying to figure out if there are any functions / datatypes dealing with ligature support.
  • Do a google search for something like "vte ligature support" or "gtk font ligature" and see if anything good comes up.

If you find some pango or gtk functions that looks promising, but aren't sure how to implement them in Termonad, feel free to post here.

@bts
Copy link
Contributor Author

bts commented Nov 19, 2018

@cdepillabout Thanks for your response! Unfortunately it seems like VTE does not currently support ligatures: https://bugzilla.gnome.org/show_bug.cgi?id=781597#c10

@cdepillabout
Copy link
Owner

@bts Ah, that's unfortunate :-\

I guess I would still suggest opening an issue on the VTE issue tracker (and then posting a link here). At the very least it would let the VTE team know that some people are interested in ligature support in VTE.

@cdepillabout cdepillabout removed the beginner-friendly Good for newcomers label Nov 19, 2018
@cdepillabout
Copy link
Owner

There does appear to be an issue on the VTE issue tracker about ligature support, but it doesn't appear to have any progress: https://gitlab.gnome.org/GNOME/vte/-/issues/192

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
help wanted Extra attention is needed
Projects
None yet
Development

No branches or pull requests

2 participants