[HarfBuzz] persian numerals

Eduardo Castiñeyra eduardo at brainstorm3d.com
Tue Sep 13 14:17:59 UTC 2016


Hi Ebrahim,

My problem is not how to change the numerals but when. For instance 
LibreOffice seems to be based on the context whereas MS Word detects the 
selected keyboard layout and takes that as the locale.

Given that I'm using the "hb_language_from_script"feature I was 
wondering whether it could deal with the locales as well.

But you are right. I was expecting not to have to solve this problem at 
all because it should be the input method the one that should deal with 
that. Now I realice if the input method fixed the problem, some 
softwares would not recognize ۲۳٫۴۵ as a number.

I will just set the locale of the script of the latest non-numeral 
character. I hope that works.

Thanks, and sorry for the off-topic!

Eduardo.

On 9/12/2016 7:55 PM, Ebrahim Byagowi wrote:
> You should resolve this on a level upper than hb as this is not just 
> about digits, but thousand and fraction separator also should be 
> replaced with their counterpart signs on different languages which 
> sometimes needs some context aware replaces (and on some locales, you 
> should switch dot with comma at once for getting correct result). If 
> you have control on number to string conversion itself, it is better 
> to ICU for this task, for example, if you 
> press (23.45).toLocaleString('fa') on Chrome or Firefox JavaScript 
> console, you will get ۲۳٫۴۵ which is provided by ICU for JavaScript.
>
> On Mon, Sep 12, 2016 at 9:25 PM, Sascha Brawer <sascha at google.com 
> <mailto:sascha at google.com>> wrote:
>
>     Which font are you using?
>
>     — Sascha
>
>     On Mon, Sep 12, 2016 at 6:09 PM, Eduardo Castiñeyra
>     <eduardo at brainstorm3d.com <mailto:eduardo at brainstorm3d.com>> wrote:
>
>         Hi,
>
>         Can hb be configured to automatically replace the numerals
>         according to the language of the paragraph ?
>
>         I'm not sure how to address this.
>
>         Thanks!
>
>         _______________________________________________
>         HarfBuzz mailing list
>         HarfBuzz at lists.freedesktop.org
>         <mailto:HarfBuzz at lists.freedesktop.org>
>         https://lists.freedesktop.org/mailman/listinfo/harfbuzz
>         <https://lists.freedesktop.org/mailman/listinfo/harfbuzz>
>
>
>
>
>     -- 
>     — Sascha
>
>
>     _______________________________________________
>     HarfBuzz mailing list
>     HarfBuzz at lists.freedesktop.org <mailto:HarfBuzz at lists.freedesktop.org>
>     https://lists.freedesktop.org/mailman/listinfo/harfbuzz
>     <https://lists.freedesktop.org/mailman/listinfo/harfbuzz>
>
>

-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/harfbuzz/attachments/20160913/b21e4a6f/attachment.html>


More information about the HarfBuzz mailing list