giu icon indicating copy to clipboard operation
giu copied to clipboard

examples: language testing example?

Open gucio321 opened this issue 4 years ago • 5 comments

hi there, It would be cool to add some code, which allows to check what languages does our OS support, and how does it change after adding some default font. it could be useful to complete a set of default fonts.

gucio321 avatar Aug 17 '21 17:08 gucio321

This is super useful, super, super... But I'm not sure we could cover that much OS...

AllenDang avatar Aug 18 '21 02:08 AllenDang

@AllenDang Not sure if this is related to this thread, but you can detect system language like this:

package main

import (
    "fmt"
    "github.com/HACKERALERT/jibber_jabber"
)

func main(){
    d,_ := jibber_jabber.DetectIETF()
    fmt.Println(d) // en-CA for me (Canadian English)
}

HACKERALERT avatar Aug 29 '21 18:08 HACKERALERT

But I'm not sure we could cover that much OS...

I meant to add a code (like a set of labels using as much as possible foreign characters) so we users can see which characters (fonts) are missing in his OS and make it easier to Need your help to add more language support by creating a PR or telling me the OS default font name for your language.

gucio321 avatar Aug 29 '21 20:08 gucio321

hi there, It would be cool to add some code, which allows to check what languages does our OS support, and how does it change after adding some default font. it could be useful to complete a set of default fonts.

On Windows, might that checking work using OS language packs ? Doesn't installing an additional system locale also add the required fonts ?

Even though that would remove the possibility that the user has a font that supports chinese (or anything else) but doesn't have the language pack installed.

You could also loop over the fonts in the system font store to check if they have glyphs for specific character ranges. https://docs.microsoft.com/en-us/typography/opentype/spec/cmap

phorcys420 avatar Jan 03 '22 01:01 phorcys420

https://github.com/ocornut/imgui/issues/2403

phorcys420 avatar Jan 06 '22 03:01 phorcys420