Tehreer / SheenBidi

A sophisticated implementation of Unicode Bidirectional Algorithm
Apache License 2.0
127 stars 21 forks source link

Using SheenBidi with utf8 #10

Closed ericoporto closed 3 years ago

ericoporto commented 3 years ago

Hi,

I am looking at a library for Bidi to pair up with Harfbuzz and FreeType for rendering text in a game engine. Do you know any project that is using SheenBidi with those so I can get a little headstart when working with these? Does SheenBidi support emojis? I am using utf8.

behdad commented 3 years ago

Check out libraqm as well, which ties FriBidi, HarfBuzz, and FreeType. If FriBidi's license is an issue, I suggest integrating SheenBidi into libraqm. cc @khaledhosny

ericoporto commented 3 years ago

@behdad thank you so much for Harfbuzz! I was worried but it took me one day and a half to get going with it - properly rendering Persian.

I looked into Fribidi, but I wasn't sure if the license would block console ports, so I decided to look for libraries with other licenses. The game engine I am looking into already has Switch and Xbox ports. Fribidi does look neat, so I may just use it, but then I am still not sure I can use it in iOS. :/

behdad commented 3 years ago

Thanks @ericoporto. FriBidi is LGPL'ed, which can cause problem in walled-garden models like iOS indeed. I can't offer any legal advice. Feel free to discuss; I'm tagging @dov who is the current maintainer.

mta452 commented 3 years ago

@ericoporto The last section in README provides example code for using SheenBidi with UTF-8 encoding. If you want to look at a game, supertuxkart is using it. If you're considering to use it in iOS or Android, Tehreer-Cocoa and Tehreer-Android are available.

ericoporto commented 3 years ago

@mta452 thank you so much! I will dive into super tux kart to see how they pulled - I think projects using it could be a line in README.

Edit: ok, found out the magic was modifying SDL_ttf directly, I will have to do this on the outside or drop SDL_ttf entirely, since that SDL_ttf doesn't track the main SDL_ttf repository.

I plan to use SheenBidi on Android and iOS too, but I like having the same codebase, so I will look into using SheenBidi directly - I am already using SDL or Allegro raster functions so I will see how to wrap it all together. You can close this.

mta452 commented 3 years ago

Great, I'll close the issue then.