TextRecognitionDataGenerator icon indicating copy to clipboard operation
TextRecognitionDataGenerator copied to clipboard

How to use single font while using GeneratorFromStrings

Open Mayank-git opened this issue 4 years ago • 2 comments

generator = GeneratorFromStrings(["Test1","Test2"],fonts=[],background_type=3)

How to assign font name in this...??? Thanks in advance.

Mayank-git avatar Apr 27 '20 10:04 Mayank-git

Just put a single font path in the fonts list.

For example, with ~/my_font.ttf you would do

generator = GeneratorFromStrings(
    ["Test1","Test2"],
    fonts=['~/my_font.ttf',],
    background_type=3
)

Belval avatar Apr 27 '20 23:04 Belval

~/

Thanks, it worked for me...

Mayank-git avatar May 01 '20 21:05 Mayank-git