asciidocfx / AsciidocFX

Asciidoc Editor and Toolchain written with JavaFX 21 (Build PDF, Epub, Mobi and HTML books, documents and slides)
http://www.asciidocfx.com/
Apache License 2.0
1.88k stars 295 forks source link

Replace font loading with general-purpose ResourceWalker #490

Open ghost opened 3 years ago

ghost commented 3 years ago

https://github.com/asciidocfx/AsciidocFX/blob/91679fe90bd2debe238ed1e0721e0e2aaf36fe72/src/main/java/com/kodedu/boot/AppStarter.java#L105

Consider using a walking the resources instead of hard-coding font names within the source code:

This also avoids a little repetition in the code. Note that the resource stream in AsciidocFX is not closed, which could be considered a bug (times seven because of the code duplication).

rahmanusta commented 3 years ago

Hi, thank you, this is true that we have to close the open stream here. Any pull requests are welcome. ResourceWalker is nice, and I like it.