Closed bai-yi-bai closed 1 year ago
Thanks for the kind words, I found and fixed the broken fallbacks, it was a small logic error in the rewrite. I'll be pushing the update now. As for setting up testing and CI, I do plan on adding it but right now my main priority is creating docs for this lib.
Also the library has a built in FontDB
which can load fonts and provide them for u wherever u need in ur code. Using the db ensures that fonts are only ever loaded once, and allows u to mix and match font fallback combinations.
ex.
# loading fonts
# FontDB.SetDefaultEmojiOptions(EmojiOptions(parse_discord_emojis=True))
FontDB.LoadFromDir(".")
FontDB.LoadSystemFonts()
# getting a font (nothing is being copied or cloned)
font = FontDB.Query("mainfont fallback1 fallback2 fallback3...")
Hi, @nathanielfernandes. I appreciate your fixes and dedication to this project!
Today I wanted to try text_wrap to compare the WordStyle.Word against WordStyle.Character output, but I encountered a problem (not an error): Font fallbacks stopped working; the missing unicode glyph character was printed out. I reverted to 2.0.1, along with my code (text_wrap to word_wrap) and characters printed out correctly.
Here's a sample of my code:
I tried moving the fonts to the root directory and specified their name, but it didn't matter.
I really admire your work on this project. I have an idea for you thought. I learned a lot from Pytlicek (Tomas Pytel) when I contributed to https://github.com/Pytlicek/sheet2dict, the key thing I learned was implementing test cases. I think it would really help to build a battery of tests before deploying.
I have two ideas about potential test cases you could use:
I'm not a great coder, I just piece together a lot of libraries and wish I had the time right now to do a PR to contribute. I don't know how Tomas set up his Github projects to perform the automated testing, but it would really benefit you long term (you have a great personal website!)