christolliday / limn

Experimental cross platform GUI library
Other
404 stars 19 forks source link

Use font-loader for loading fonts #4

Closed jrmuizel closed 6 years ago

jrmuizel commented 6 years ago

It's not very sophisticated but it works on all platforms and is better than having to include fonts in assets. It's what we use for font-loading in webrender/wrench.

valpackett commented 6 years ago

It uses fontconfig, which seems plenty sophisticated to me :D

matprec commented 6 years ago

[Disclaimer:Author] I think he meant sophisticated on its own, which is right! It provides a minimalistic wrapper over the native font capabilities. It could probably do more things, like trying to query the systems default fonts or something, but nobody declared interest in such features yet.

Its meant specifically to support such libraries. If there are questions/suggestions, feel free to open issues!

christolliday commented 6 years ago

Yeah thanks for the heads up, wasn't aware of this library but ultimately this functionality will be needed, and it would be nice to have it as a dependency.

@MSleepyPanda I'm wondering though, does it support Android/iOS or is it planned to? It will probably be a while before limn is usable on those platforms but I still want to keep them in mind and minimize changes that will make it harder to support them.

matprec commented 6 years ago

It should make sense to support those two targets as well, but we currently don't. Opened issues for both!

christolliday commented 6 years ago

Thanks! I should mention that adding support for those to font-loader shouldn't be a pre-requisite for adding font-loader support to limn. If anybody is interested in working on it, PRs are welcome! If no one gets around to working on it I'll add it eventually, but it's not high priority for me yet.

fschutt commented 6 years ago

Also, please don't do this for images, either. limn should not be responsible for loading the data of images and loading fonts. These could, for example come over the network (ex. an FTP program that views data from a remote server). This is up to the user of the binary - limn should only have a R: std::io::Read trait bound and that's it.

christolliday commented 6 years ago

font-loader support added by #39