some fixes for ved and the macos CI

This commit is contained in:
Delyan Angelov 2025-07-24 19:10:52 +03:00
parent 9e20dddef2
commit 83afa24626
No known key found for this signature in database
GPG key ID: 66886C0F12D595ED
3 changed files with 6 additions and 31 deletions

View file

@ -2,6 +2,9 @@
// Use of this source code is governed by an MIT license that can be found in the LICENSE file. // Use of this source code is governed by an MIT license that can be found in the LICENSE file.
module gg module gg
pub const align_right = HorizontalAlign.right
pub const align_left = HorizontalAlign.left
struct FTConfig { struct FTConfig {
font_path string font_path string
custom_bold_font_path string custom_bold_font_path string

View file

@ -1,20 +1,8 @@
module gx module gx
import fontstash as _ import fontstash as _
import gg
@[deprecated: 'use gg.HorizontalAlign instead'] pub type HorizontalAlign = gg.HorizontalAlign
@[deprecated_after: '2026-01-24']
pub enum HorizontalAlign {
left = C.FONS_ALIGN_LEFT
center = C.FONS_ALIGN_CENTER
right = C.FONS_ALIGN_RIGHT
}
@[deprecated: 'use gg.VerticalAlign instead'] pub type VerticalAlign = gg.VerticalAlign
@[deprecated_after: '2026-01-24']
pub enum VerticalAlign {
top = C.FONS_ALIGN_TOP
middle = C.FONS_ALIGN_MIDDLE
bottom = C.FONS_ALIGN_BOTTOM
baseline = C.FONS_ALIGN_BASELINE
}

View file

@ -7,19 +7,3 @@ pub const align_left = HorizontalAlign.left
pub const align_right = HorizontalAlign.right pub const align_right = HorizontalAlign.right
pub type TextCfg = gg.TextCfg pub type TextCfg = gg.TextCfg
// to_css_string returns a CSS compatible string of the TextCfg `cfg`.
// For example: `'mono 14px serif'`.
pub fn (cfg &TextCfg) to_css_string() string {
mut font_style := ''
if cfg.bold {
font_style += 'bold '
}
if cfg.mono {
font_style += 'mono '
}
if cfg.italic {
font_style += 'italic '
}
return '${font_style} ${cfg.size}px ${cfg.family}'
}