Hieroglyphic icon indicating copy to clipboard operation
Hieroglyphic copied to clipboard

feat: support for typst

Open Bnyro opened this issue 4 months ago • 4 comments

This PR adds some basic typst support by mapping latex symbols to typst symbols with help of https://github.com/mitex-rs/mitex and https://typst.app/docs/reference/symbols/sym/.

The way it's displayed in the UI is not great - but I didn't want to add a toggle to switch between LaTeX and Typst.

closes https://github.com/FineFindus/Hieroglyphic/issues/17

Bnyro avatar Aug 19 '25 16:08 Bnyro

Okay, so far so good.

What's still missing:

  • When the user changes from Typst to Latex mode (or vice-versa), the symbol list is not automatically update. It's only updated when the user starts to draw something again.
  • ~The menu to switch between Latex and Typst doesn't have this radio button look like Gnome Weather does - I've really no idea how to make that work with gtk-rs.~

Help for both really much appreciated, they should be quick enough to implement if somebody knows how :)

PS: The settings enum handling is a bit weird here, but I've now idea how to improve it.

Bnyro avatar Nov 19 '25 20:11 Bnyro

When the user changes from Typst to Latex mode (or vice-versa), the symbol list is not automatically update. It's only updated when the user starts to draw something again.

You can add a listener (e.g. connect_changed) that just recreates the symbol list when the preference is changed. Or I guess since it's only possible to change through the menu action, it's probably better to just update the list there.

PS: The settings enum handling is a bit weird here, but I've now idea how to improve it.

I can take a look later.

FineFindus avatar Nov 26 '25 19:11 FineFindus

PS: The settings enum handling is a bit weird here, but I've now idea how to improve it.

I can take a look later.

Not necessary, I already fixed that :)

From a feature perspective, only the automatic list update is missing

Bnyro avatar Nov 26 '25 19:11 Bnyro

You can add a listener (e.g. connect_changed) that just recreates the symbol list when the preference is changed. Or I guess since it's only possible to change through the menu action, it's probably better to just update the list there.

It'd be great if you could look into that please, I don't really understand how we can actually update the list here to since there is some strange stuff going on with channels and asynchronous senders for communication and I don't want to use weird hacks :)

Bnyro avatar Nov 26 '25 19:11 Bnyro