diff --git a/vlib/gg/text_rendering.v b/vlib/gg/text_rendering.v index 97a8ba1f73..8ceee9f765 100644 --- a/vlib/gg/text_rendering.v +++ b/vlib/gg/text_rendering.v @@ -2,6 +2,9 @@ // Use of this source code is governed by an MIT license that can be found in the LICENSE file. module gg +pub const align_right = HorizontalAlign.right +pub const align_left = HorizontalAlign.left + struct FTConfig { font_path string custom_bold_font_path string diff --git a/vlib/gx/text.c.v b/vlib/gx/text.c.v index 2d87afcc01..e5f87fbe0d 100644 --- a/vlib/gx/text.c.v +++ b/vlib/gx/text.c.v @@ -1,20 +1,8 @@ module gx import fontstash as _ +import gg -@[deprecated: 'use gg.HorizontalAlign instead'] -@[deprecated_after: '2026-01-24'] -pub enum HorizontalAlign { - left = C.FONS_ALIGN_LEFT - center = C.FONS_ALIGN_CENTER - right = C.FONS_ALIGN_RIGHT -} +pub type HorizontalAlign = gg.HorizontalAlign -@[deprecated: 'use gg.VerticalAlign instead'] -@[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 -} +pub type VerticalAlign = gg.VerticalAlign diff --git a/vlib/gx/text.v b/vlib/gx/text.v index f8d2016e3a..39d4f28cda 100644 --- a/vlib/gx/text.v +++ b/vlib/gx/text.v @@ -7,19 +7,3 @@ pub const align_left = HorizontalAlign.left pub const align_right = HorizontalAlign.right 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}' -}