harfbuzz-tutorial icon indicating copy to clipboard operation
harfbuzz-tutorial copied to clipboard

Link of "walkthrough of the example" broken

Open sanketgarade opened this issue 2 years ago • 5 comments

In the main repo wiki, under user examples, i followed the below links to this repo and its walkthrough, but the later one is broken.

harfbuzz-tutorial, along with the walk-though accompanying that.

I searched on the flossmanuals website but didn't find anything related to "harfbuzz". I am trying to contact them to find out if they have the article and can restore it.

Meanwhile I was wondering if you guys have the walkthrough saved at some other place too? (I am trying to integrate harfbuzz into Organic Maps and wanted to study and understand some examples.)

sanketgarade avatar Apr 27 '23 09:04 sanketgarade

Meanwhile I was wondering if you guys have the walkthrough saved at some other place too? (I am trying to integrate harfbuzz into Organic Maps and wanted to study and understand some examples.)

Looks like you already use FreeType, so I recommend you give libraqm a try. Its decomentation has a small, standalone, example.

khaledhosny avatar Apr 27 '23 10:04 khaledhosny

so I recommend you give libraqm a try.

Hello

Thanks for the suggestion. I'm very new to text processing and rendering etc. so I'm sorry but I have some basic questions.

  • Does your library support all scripts that harfbuzz supports?
  • What is the benefit of using your library instead of directly integrating harfbuzz into organic maps?
  • Similarly are there demerits if any?
  • Organic maps app work on Linux, macOS, windows, android, iOS. Does your library work on all these?

sanketgarade avatar Apr 27 '23 15:04 sanketgarade

To do proper text layout you need to segment text into script segments, segment text into directional segment, and finally shape each segment. HarfBuzz does the last step, Raqm handles everything and calls the relevant libraries including HarfBuzz. It is basically a glue layer so every application does not have to re-do the same things, plus other convenience APIs. It is a single file library, so you can also use it as an example on how to properly use HarfBuzz if you don’t want to use it directly.

khaledhosny avatar Apr 27 '23 15:04 khaledhosny

See also What does HarfBuzz do and What HarfBuzz doesn't do, Raqm does some of the things HarfBuzz doesn’t do.

khaledhosny avatar Apr 27 '23 15:04 khaledhosny

FreeType is very low-level for text rendering. Something like Cairo makes it easier, and gives you more options. The basic procedure for rendering a line of bidirectional text can be something like

  • Use FriBidi to split the line into unidirectional text runs
  • Use HarfBuzz to “shape” each text run, choosing and positioning the right glyphs to render the given text
  • Use Cairo to render each run of text glyphs.

Of course, issues like multiple font styles, line-splitting and hyphenation are extra.

ldo avatar Jul 28 '23 05:07 ldo