Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unicode symbols and invalid images #280

Open
avber opened this issue Jul 17, 2022 · 3 comments
Open

Unicode symbols and invalid images #280

avber opened this issue Jul 17, 2022 · 3 comments
Labels

Comments

@avber
Copy link

avber commented Jul 17, 2022

colab code

!mkdir /usr/local/lib/python3.7/dist-packages/trdg/fonts/kzdigits
!cp /content/fonts/. /usr/local/lib/python3.7/dist-packages/trdg/fonts/kzdigits/

e.g. Verdana.ttf

generator = GeneratorFromRandom(
blur=0,
random_blur=False,
random_skew=True,
language='kzdigits'
)

print(generator.generator.fonts) #Verdana.ttf

Sometimes the generator produces a valid image
image

Sometimes not

image

The ₸ sign is not displayed.

@Belval
Copy link
Owner

Belval commented Jul 18, 2022

I'm a bit confused. Are both of those generated with generator.generator.fonts = ['Verdana.ttf']?

@avber
Copy link
Author

avber commented Jul 19, 2022

I was confused as well. Seems like fonts are ignored.
The fonts were supposed to be loaded internally by specifying language='kzdigits'

@Belval Belval added the bug label Sep 3, 2022
@Sayaka91
Copy link

Sayaka91 commented Aug 3, 2023

@avber @Belval
This bug happens because the font doesn't support the character. I added a function to check that and this bug dissappears.
image

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

3 participants