mirror of
https://github.com/vlang/v.git
synced 2025-09-13 22:42:26 +03:00
some fixes for ved and the macos CI
This commit is contained in:
parent
9e20dddef2
commit
83afa24626
3 changed files with 6 additions and 31 deletions
|
@ -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
|
||||||
|
|
|
@ -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
|
|
||||||
}
|
|
||||||
|
|
|
@ -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}'
|
|
||||||
}
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue