Comments (7)
Hey @EldarAgalarov,
the direct GR wrapper GR.jl has support for custom user fonts, see the user_fonts.jl
example as a reference. However, I don't know if GR.jl and Plots can be mixed together. Probably @jheinen can tell more about this.
from gr.
Could you please try:
ENV["GKS_FONT_DIRS"] = joinpath(pwd(), "Documents", "inter") # Inter.ttf
using Plots
default(fontfamily="Inter")
p = plot(1:10, rand(10), title = "Title", label = "Label", xguide = "xGuide", yguide = "yGuide")
This plot was created using a symbolic link Inter.ttf => Inter-Regular.ttf
.
from gr.
Hi,
we only bundle a very limited amount of fonts to keep the GR runtime downloads small. For this reason we even removed existing fonts and instead added the gr_loadfont
function, with the help of which you can load arbitrary fonts.
This function also searches the default font directories of the operating system, so if you presumably have Inter
installed, this snippet should be sufficient to use the Inter
font in GR:
int font;
gr_loadfont("Inter-Regular.ttf", &font);
if (font >= 0) {
gr_settextfontprec(font, 3);
}
from gr.
Hi @danielkaiser
Can I load Inter font into GR using Julia? I'm using GR Framework as backend of the Julian's Plots library.
from gr.
Hi @EldarAgalarov,
with this commit by @jheinen in Plots.jl (included since version 1.38.6) loading of custom fonts with the GR backend should be supported there as well.
Does this solve your issue?
from gr.
Hi @danielkaiser
Tried without success:
using Plots
ENV["GKS_FONT_DIRS"] = joinpath(pwd(), "Documents", "inter") # Inter.ttf
p = plot(1:10, rand(10), title = "Title", label = "Label", xguide = "xGuide", yguide = "yGuide")
f = font("Inter")
Plots.gr_set_font(f, p[1])
p
from gr.
Hi @jheinen Your code works!
PS. It would be nice to add support for variable fonts (all styles are packed into one file) and for OpenType fonts (.otf).
from gr.
Related Issues (20)
- GR is slower than MPL HOT 7
- Innacurate Drawing Of Some Chart Elements HOT 1
- Confirm file successfully written to or not - troubleshooting Julia/Plots/CI issue HOT 1
- Provide a verbatim mode
- soname versioning HOT 1
- Replace gethostbyname with getaddrinfo HOT 2
- Rotating polar plot coordinates? HOT 6
- Python: Is there a way to detect if a plot window has been closed? HOT 3
- 978b2a786834c7c7cd48542e802e857cd8d9302d brings link problem HOT 18
- Plotting multiple lines using C api HOT 4
- Polyline not plotting on simple example HOT 3
- JS Problems HOT 2
- When used as backend for matplotlib, GR can't export to svg HOT 6
- Performance Consistency Issues HOT 3
- Latest version from pip not working on Windows for NICOS HOT 6
- Update GR_jll to Qt6.5 HOT 2
- Javascript Polyline HOT 1
- Fill Entire Workspace Fullscreen using GKSQt HOT 10
- Python - Windows: GKS: Qt6 support not compiled in HOT 4
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from gr.