Giter Site home page Giter Site logo

Any plans for i18n text support? about flatui HOT 3 CLOSED

google avatar google commented on May 17, 2024
Any plans for i18n text support?

from flatui.

Comments (3)

hak avatar hak commented on May 17, 2024

In master, now it supports SetTextLocale() API.
With the API, for instance SetTextLocale('ar'), Label/Edit widget support RTL languages.

Items not supported yet are:

  • Font fallback when a font doesn't include some glyphs.
    I'm working on the feature.
  • Unicode BiDi control characters.
    http://www.i18nguy.com/markup/right-to-left.html
  • Switching other layout directions (e.g. Group layout direction)
    Not sure if it's necessary. Any feedback is appreciated.
  • Script detection.
    I'm leaning toward not to have the feature since,

from flatui.

preet avatar preet commented on May 17, 2024

Setting locale seems like a good solution for single language support, but once you mix in multiple languages at once you might need BiDi and script direction to pass information along to Harfbuzz when you do shaping. I've been looking for a small lib to handle i18n mixed text rendering for me and thought I'd push the responsibility on to you :p

If multiple languages in text isn't worth supporting, I think setting locale is good enough. If there are plans to support it, then you need fallback (I can't see fallback mattering too much if you stick to a single language as most fonts are designed to support at least one language unless Im missing something), BiDi and script detection.

I've tried to do something similar to what flatui is doing for text rendering and ended up using harfbuzz+libunibreak+ICU (for bidi and script detection)... ICU is a huge dep. There might be other independent BiDi libraries with a compatible license too though (like https://github.com/mta452/SheenBidi, untested)

My specific use case is rendering map labels which may contain mixed i18n text. This is pretty niche, so whether or not mixed i18n text is in the scope of this project is up to you folks.

from flatui.

hak avatar hak commented on May 17, 2024

Locale support is added in /develop branch.

from flatui.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.