You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
This is very much an enhancement: would it be an option to switch to Go fonts by default?
Visually, I think it's sensible to adopt a shared look and feel for Go libraries. The font's quirky but it immediately says 'Golang'.
More importantly, though, the library could shed its dependency on the filesystem. Clearly go install works fine if the system is set up just so, but I much prefer distributing single-file binaries with everything packed in. (So I just double-click that? Uh, terminal's over here but I guess so. Boom no fonts.)
The font naming that's in place currently is clearly valuable (though I prefer to load the fonts via go-bindata's byte arrays) but for a general-purpose library it's much simpler to default to:
Thanks, @gerald1248, for this idea.
I'm currently using go fonts in draw2d like this:
(Note: I use only Name attribute of FontData for simplification.)
Maybe this font (goregular) could be part of draw2d as default font. They (all go fonts) could be automatically preloaded in similar way in defaultFontCache.
Reacted by llgcode, redstarcoder, Gerald Schmidt, Diego Medina, Max McDonnell and CasMc
@Drahoslav7: This is pretty much exactly what I'm using in my custom font cache (GitHub).
The question is how do deal with the existing library layout and expectation that fonts are fetched from the filesystem. For example, I've thrown out the resource folder but then I have to set the font directory to . to avoid errors being thrown.
The existing font namer etc. is all working and useful but ideally it would be an optional extra. As far as I can tell, mapping bytearrays to the font descriptors the way you've done looks to me like the most Go-like way to do it.
Activity
llgcode commentedon Dec 15, 2016
Hi @gerald1248
An article on how to use it in draw2d can be interesting.
drahoslove commentedon Dec 18, 2016
Thanks, @gerald1248, for this idea.
I'm currently using go fonts in
draw2dlike this:(Note: I use only
Nameattribute ofFontDatafor simplification.)Maybe this font (
goregular) could be part ofdraw2das default font. They (all go fonts) could be automatically preloaded in similar way indefaultFontCache.gerald1248 commentedon Dec 21, 2016
@Drahoslav7: This is pretty much exactly what I'm using in my custom font cache (GitHub).
The question is how do deal with the existing library layout and expectation that fonts are fetched from the filesystem. For example, I've thrown out the resource folder but then I have to set the font directory to
.to avoid errors being thrown.The existing font namer etc. is all working and useful but ideally it would be an optional extra. As far as I can tell, mapping bytearrays to the font descriptors the way you've done looks to me like the most Go-like way to do it.