GraphiteEditor / Graphite

2D vector & raster editor that melds traditional layers & tools with a modern node-based, non-destructive, procedural workflow.
https://graphite.rs
Apache License 2.0
7.29k stars 385 forks source link

planning for better handling of text & complex script languages #1787

Closed Bilal2453 closed 1 week ago

Bilal2453 commented 1 week ago

I've only tested Graphite briefly as it was suggested to me by a friend, and as I tried to write in Arabic some issues were apparent.

Text doesn't seem to be handled in anyway besides just rendering it? Is it just Harfbuzz shaping behind the scene (perhaps through the browser engine)? For example the unicode bidirectional algorithm (as implemented by FriBidi for example) is never applied which often browsers do apply, I don't see a way in the UI to force RTL rendering (or LTR for that matter), there doesn't appear to be a paragraph alignment, and somewhat importantly, there is no font fallback when some glyphs fail to render under some font. Below attached a showcase video, and another one of expected behavior on something like GIMP, with the example text الأسرب Graphite أفضل محرر للصور! (Graphite ['Usrub] is the best image editor!). Feel free to mark this as duplicate if so, a quick issues search didn't reveal much!

Screencast from 2024-06-16 21-47-06.webm Screencast from 2024-06-16 22-06-21.webm

0HyperCube commented 1 week ago

Thanks for reporting @Bilal2453. Graphite is very early prototype software and I would suggest an alternative like Inkscape or Krita for more mature vector or raster editing.

The current text support is using rustybuzz (a port of harfbuzz) shaping. The text editing is not very good and some necessary improvements such as font fallbacks, text spans, and alignment are tracked in issue #1105. Bi-directional text is something we haven't yet considered much but would like to keep in mind.

Bilal2453 commented 1 week ago

Hey @0HyperCube thanks for the reply. Sounds good! I am really only reporting this here for planning purposes in case that wasn't already done.

One potential thing that may come up in the future is applying a text stroke. Currently seems like the glyphs aren't joined in any way (similar to Inkscape), which in a vector application may make sense, but for a text/raster application it is going to break for scripts and fonts with connected glyphs, might want to keep track of that too in the future!

I've heard about rustybuzz and was a bit skeptical considering how much work went into Harfbuzz, but seems like it is working just fine over here.

Will close for now as the bidi impl is now being tracked in the aforementioned issue.