gr: added initial support for GR vector fonts

This commit is contained in:
Josef Heinen 2020-04-11 09:46:03 +02:00
parent 03a27994d5
commit c238d42e83

View File

@ -67,6 +67,11 @@ const gr_font_family = Dict(
"palatino" => 26
)
const gr_vector_font = Dict(
"serif-roman" => 232,
"sans-serif" => 233
)
# --------------------------------------------------------------------------------------
gr_color(c) = gr_color(c, color_type(c))
@ -390,6 +395,8 @@ function gr_set_font(f::Font; halign = f.halign, valign = f.valign,
GR.setcharup(sind(-rotation), cosd(-rotation))
if haskey(gr_font_family, family)
GR.settextfontprec(100 + gr_font_family[family], GR.TEXT_PRECISION_STRING)
elseif haskey(gr_vector_font, family)
GR.settextfontprec(gr_vector_font[family], 3)
end
gr_set_textcolor(color)
GR.settextalign(gr_halign[halign], gr_valign[valign])