1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

gg: always use stb_truetype for now

This commit is contained in:
Alexander Medvednikov 2020-07-13 01:02:47 +02:00
parent f1fdafcdff
commit db2346069a
3 changed files with 6 additions and 1 deletions

View File

@ -172,6 +172,7 @@ FONS_DEF void fonsDrawDebug(FONScontext* s, float x, float y);
#endif #endif
#endif #endif
#undef FONS_USE_FREETYPE
#ifdef FONS_USE_FREETYPE #ifdef FONS_USE_FREETYPE

View File

@ -215,6 +215,9 @@ pub fn (ctx &Context) draw_empty_rect(x, y, w, h f32, c gx.Color) {
sgl.end() sgl.end()
} }
pub fn (ctx &Context) draw_circle(x, y, r f32, c gx.Color) {
}
pub fn create_image(file string) u32 { pub fn create_image(file string) u32 {
// println('gg create image "$file"') // println('gg create image "$file"')
if !os.exists(file) { if !os.exists(file) {

View File

@ -51,7 +51,8 @@ pub fn (ctx &Context) draw_text(x, y int, text string, cfg gx.TextCfg) {
} }
ctx.ft.fons.set_font(ctx.ft.font_normal) ctx.ft.fons.set_font(ctx.ft.font_normal)
scale := if ctx.ft.scale == 0 { f32(1) } else { ctx.ft.scale } scale := if ctx.ft.scale == 0 { f32(1) } else { ctx.ft.scale }
ctx.ft.fons.set_size(scale * f32(cfg.size)) size := if cfg.size == 0 { gg.default_font_size } else { cfg.size }
ctx.ft.fons.set_size(scale * f32(size))
if cfg.align == gx.align_right { if cfg.align == gx.align_right {
C.fonsSetAlign(ctx.ft.fons, C.FONS_ALIGN_RIGHT | C.FONS_ALIGN_TOP) C.fonsSetAlign(ctx.ft.fons, C.FONS_ALIGN_RIGHT | C.FONS_ALIGN_TOP)
} }