2022-01-04 09:21:08 +00:00
|
|
|
// Copyright (c) 2019-2022 Alexander Medvednikov. All rights reserved.
|
2020-07-06 18:29:05 +00: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 13:35:37 +00:00
|
|
|
|
2021-08-12 19:31:04 +00:00
|
|
|
import gx
|
2020-06-02 13:35:37 +00:00
|
|
|
|
2020-07-06 19:40:24 +00:00
|
|
|
struct FTConfig {
|
2020-12-04 23:03:46 +00:00
|
|
|
font_path string
|
2020-12-01 15:30:22 +00:00
|
|
|
custom_bold_font_path string
|
2020-12-04 23:03:46 +00:00
|
|
|
scale f32 = 1.0
|
|
|
|
font_size int
|
2022-04-15 12:35:35 +00:00
|
|
|
bytes_normal []u8
|
|
|
|
bytes_bold []u8
|
|
|
|
bytes_mono []u8
|
|
|
|
bytes_italic []u8
|
2020-06-02 13:35:37 +00:00
|
|
|
}
|
|
|
|
|
2021-01-23 09:25:40 +00:00
|
|
|
struct StringToRender {
|
|
|
|
x int
|
|
|
|
y int
|
|
|
|
text string
|
|
|
|
cfg gx.TextCfg
|
|
|
|
}
|
|
|
|
|
2021-10-07 00:45:02 +00:00
|
|
|
[if debug_font ?]
|
2020-09-26 06:36:46 +00:00
|
|
|
fn debug_font_println(s string) {
|
2021-10-07 00:45:02 +00:00
|
|
|
println(s)
|
2020-09-26 06:36:46 +00:00
|
|
|
}
|