2021-01-18 15:20:06 +03:00
|
|
|
// Copyright (c) 2019-2021 Alexander Medvednikov. All rights reserved.
|
2020-07-06 21:29:05 +03:00
|
|
|
// Use of this source code is governed by an MIT license that can be found in the LICENSE file.
|
|
|
|
module gg
|
2020-06-02 16:35:37 +03:00
|
|
|
|
2021-08-12 22:31:04 +03:00
|
|
|
import gx
|
2020-06-02 16:35:37 +03:00
|
|
|
|
2020-09-25 12:52:57 +03:00
|
|
|
enum FontVariant {
|
|
|
|
normal = 0
|
|
|
|
bold
|
|
|
|
mono
|
|
|
|
italic
|
|
|
|
}
|
|
|
|
|
2020-07-06 22:40:24 +03:00
|
|
|
struct FTConfig {
|
2020-12-05 02:03:46 +03:00
|
|
|
font_path string
|
2020-12-01 18:30:22 +03:00
|
|
|
custom_bold_font_path string
|
2020-12-05 02:03:46 +03:00
|
|
|
scale f32 = 1.0
|
|
|
|
font_size int
|
2021-01-22 00:07:47 +03:00
|
|
|
bytes_normal []byte
|
|
|
|
bytes_bold []byte
|
|
|
|
bytes_mono []byte
|
|
|
|
bytes_italic []byte
|
2020-06-02 16:35:37 +03:00
|
|
|
}
|
|
|
|
|
2021-01-23 12:25:40 +03:00
|
|
|
struct StringToRender {
|
|
|
|
x int
|
|
|
|
y int
|
|
|
|
text string
|
|
|
|
cfg gx.TextCfg
|
|
|
|
}
|
|
|
|
|
2021-10-07 03:45:02 +03:00
|
|
|
[if debug_font ?]
|
2020-09-26 09:36:46 +03:00
|
|
|
fn debug_font_println(s string) {
|
2021-10-07 03:45:02 +03:00
|
|
|
println(s)
|
2020-09-26 09:36:46 +03:00
|
|
|
}
|