Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 6 additions & 1 deletion docs/ART_STYLE.md
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ slope, height and world-space noise, so any heightfield is shaded for free.
Concord field equipment uses steel-blue chamfered plates, subtle outlines and
cyan instrument lamps. Orange marks warnings. `HudStyle`, `PlateStyle` and
`HudTheme` provide the shared controls; `UiTheme` applies the stock-control theme
before screens are built. Chakra Petch supplies body, button and heading weights.
before screens are built. Saira supplies body, button and heading weights.
Its SIL Open Font Licence is bundled under `game/assets/fonts/OFL.txt`, included
in exports and displayed in Credits.

Expand All @@ -84,3 +84,8 @@ The title keeps its main play actions in a vertical stack, with secondary action
in a compact two-column group. Heading size and spacing adapt to shorter windows;
the supported 1152×648 layout fits at 100% and 130% UI scale without a scrollbar.
Very short windows retain an emergency scrolling fallback so actions stay reachable.

Typography uses Saira at normal width (100): regular 400 for body text, medium
500 for buttons, and semibold 600 for headings. Help pages and mission briefings
use 16 px text with 4 px extra line spacing. The bundled variable font and
SIL Open Font License live in `game/assets/fonts/`.
Binary file removed game/assets/fonts/ChakraPetch-Medium.ttf
Binary file not shown.
Binary file removed game/assets/fonts/ChakraPetch-Regular.ttf
Binary file not shown.
36 changes: 0 additions & 36 deletions game/assets/fonts/ChakraPetch-Regular.ttf.import

This file was deleted.

Binary file removed game/assets/fonts/ChakraPetch-SemiBold.ttf
Binary file not shown.
36 changes: 0 additions & 36 deletions game/assets/fonts/ChakraPetch-SemiBold.ttf.import

This file was deleted.

5 changes: 3 additions & 2 deletions game/assets/fonts/OFL.txt
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
Copyright 2018 The Chakra Petch Project Authors (https://github.com/m4rc1e/Chakra-Petch.git)
Copyright 2020 The Saira Project Authors (https://github.com/Omnibus-Type/Saira)


This Font Software is licensed under the SIL Open Font License, Version 1.1.
This license is copied below, and is also available with a FAQ at:
http://scripts.sil.org/OFL
https://scripts.sil.org/OFL


-----------------------------------------------------------
Expand Down
10 changes: 10 additions & 0 deletions game/assets/fonts/Saira-Medium.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[gd_resource type="FontVariation" load_steps=2 format=3]

[ext_resource type="FontFile" path="res://assets/fonts/Saira.ttf" id="1"]

[resource]
base_font = ExtResource("1")
variation_opentype = {
2003265652: 500.0,
2003072104: 100.0
}
10 changes: 10 additions & 0 deletions game/assets/fonts/Saira-Regular.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[gd_resource type="FontVariation" load_steps=2 format=3]

[ext_resource type="FontFile" path="res://assets/fonts/Saira.ttf" id="1"]

[resource]
base_font = ExtResource("1")
variation_opentype = {
2003265652: 400.0,
2003072104: 100.0
}
10 changes: 10 additions & 0 deletions game/assets/fonts/Saira-SemiBold.tres
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
[gd_resource type="FontVariation" load_steps=2 format=3]

[ext_resource type="FontFile" path="res://assets/fonts/Saira.ttf" id="1"]

[resource]
base_font = ExtResource("1")
variation_opentype = {
2003265652: 600.0,
2003072104: 100.0
}
Binary file added game/assets/fonts/Saira.ttf
Binary file not shown.
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

importer="font_data_dynamic"
type="FontFile"
uid="uid://dte7co0h0a4mr"
path="res://.godot/imported/ChakraPetch-Medium.ttf-78a016a08515eee6e20491208eeba7e4.fontdata"
uid="uid://quqms5mdgun0"
path="res://.godot/imported/Saira.ttf-36935d665899663006e89e28bf9c9c7d.fontdata"

[deps]

source_file="res://assets/fonts/ChakraPetch-Medium.ttf"
dest_files=["res://.godot/imported/ChakraPetch-Medium.ttf-78a016a08515eee6e20491208eeba7e4.fontdata"]
source_file="res://assets/fonts/Saira.ttf"
dest_files=["res://.godot/imported/Saira.ttf-36935d665899663006e89e28bf9c9c7d.fontdata"]

[params]

Expand All @@ -22,8 +22,8 @@ msdf_size=48
allow_system_fallback=true
force_autohinter=false
modulate_color_glyphs=false
hinting=3
subpixel_positioning=4
hinting=1
subpixel_positioning=1
keep_rounding_remainders=true
oversampling=0.0
Fallbacks=null
Expand Down
24 changes: 24 additions & 0 deletions game/tests/ui/test_typography.gd
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
extends GutTest
## The variable font must select real body/button/heading weights, not its Thin default.


func test_saira_roles_keep_normal_width_and_readable_weights() -> void:
var roles: Dictionary = {
HudStyle.FONT_BODY: 400.0, HudStyle.FONT_BUTTON: 500.0, HudStyle.FONT_HEADING: 600.0
}
for path: String in roles:
var font: FontVariation = HudStyle.font(path) as FontVariation
assert_not_null(font, path)
var weight: float = font.variation_opentype[2003265652]
var expected: float = roles[path]
assert_eq(weight, expected)
var width: float = font.variation_opentype[2003072104]
assert_eq(width, 100.0)
for character: String in ["A", "a", "0", "1", "·", "…", "—"]:
assert_true(font.has_char(character.unicode_at(0)), character)


func test_credits_include_the_bundled_saira_license() -> void:
var license_text: String = FileAccess.get_file_as_string("res://assets/fonts/OFL.txt")
assert_true(license_text.contains("Saira Project Authors"))
assert_true(license_text.contains("SIL OPEN FONT LICENSE Version 1.1"))
1 change: 1 addition & 0 deletions game/tests/ui/test_typography.gd.uid
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
uid://crduy73wi2e4a
3 changes: 2 additions & 1 deletion game/ui/briefing_panel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -56,7 +56,8 @@ func _ready() -> void:
var body := VBoxContainer.new()
body.add_theme_constant_override(&"separation", 10)
column.add_scroll(body)
_text = HudStyle.make_label(14, HudStyle.TEXT_COLOR)
_text = HudStyle.make_label(16, HudStyle.TEXT_COLOR)
_text.add_theme_constant_override(&"line_spacing", 4)
_text.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
_text.custom_minimum_size = Vector2(WIDTH, 0)
body.add_child(_text)
Expand Down
8 changes: 4 additions & 4 deletions game/ui/hud_style.gd
Original file line number Diff line number Diff line change
Expand Up @@ -34,11 +34,11 @@ const PANEL_CUT := 10.0
const BUTTON_CUT := 6.0
## Labels this large or larger are set in the heading weight.
const HEADING_SIZE := 18
## The typeface (Chakra Petch, SIL Open Font License) by weight. Loaded on first use,
## The typeface (Saira, SIL Open Font License) by weight. Loaded on first use,
## not preloaded: a fresh checkout parses this script before the fonts are imported.
const FONT_BODY: String = "res://assets/fonts/ChakraPetch-Regular.ttf"
const FONT_BUTTON: String = "res://assets/fonts/ChakraPetch-Medium.ttf"
const FONT_HEADING: String = "res://assets/fonts/ChakraPetch-SemiBold.ttf"
const FONT_BODY: String = "res://assets/fonts/Saira-Regular.tres"
const FONT_BUTTON: String = "res://assets/fonts/Saira-Medium.tres"
const FONT_HEADING: String = "res://assets/fonts/Saira-SemiBold.tres"


## The font at `path` (FONT_BODY, FONT_BUTTON, FONT_HEADING).
Expand Down
7 changes: 4 additions & 3 deletions game/ui/info_panel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,8 @@ func _ready() -> void:
column.add_child(_kicker)
_heading = HudStyle.make_label(26, HudStyle.TEXT_COLOR)
column.add_child(_heading)
_body = HudStyle.make_label(13, HudStyle.TEXT_COLOR)
_body = HudStyle.make_label(16, HudStyle.TEXT_COLOR)
_body.add_theme_constant_override(&"line_spacing", 4)
_body.autowrap_mode = TextServer.AUTOWRAP_WORD_SMART
_body.size_flags_horizontal = Control.SIZE_EXPAND_FILL
_scroll = column.add_scroll(_body, HEIGHT)
Expand Down Expand Up @@ -311,9 +312,9 @@ static func credits_text() -> String:
),
'GUT, the Godot Unit Test framework, by Tom "Butch" Wesley and contributors, MIT licence.',
"gdtoolkit (gdformat, gdlint), by Pawel Lampe and contributors, MIT licence.",
"Chakra Petch, Copyright 2018 The Chakra Petch Project Authors, SIL Open Font Licence 1.1.",
"Saira, Copyright 2020 The Saira Project Authors, SIL Open Font Licence 1.1.",
"",
"CHAKRA PETCH FONT LICENCE",
"SAIRA FONT LICENCE",
FileAccess.get_file_as_string("res://assets/fonts/OFL.txt").strip_edges(),
"",
"GODOT ENGINE LICENCE",
Expand Down
6 changes: 3 additions & 3 deletions game/ui/save_load_panel.gd
Original file line number Diff line number Diff line change
Expand Up @@ -40,16 +40,16 @@ func _ready() -> void:
panel.add_theme_stylebox_override(&"panel", HudStyle.solid_panel_style())
panel.mouse_filter = Control.MOUSE_FILTER_STOP
centre.add_child(panel)
var column := VBoxContainer.new()
var column := FitColumn.new(8)
column.custom_minimum_size = Vector2(WIDTH, 0)
column.add_theme_constant_override(&"separation", 8)
column.outer_margin = 48.0 + panel.get_theme_stylebox(&"panel").get_minimum_size().y
panel.add_child(column)
column.add_child(HudStyle.make_label(11, HudStyle.ACCENT_COLOR, "THE CONCORD SURVEY"))
_heading = HudStyle.make_label(26, HudStyle.TEXT_COLOR, "Save")
column.add_child(_heading)
_rows = VBoxContainer.new()
_rows.add_theme_constant_override(&"separation", 6)
column.add_child(_rows)
column.add_scroll(_rows)
for slot: StringName in SaveSlots.slots():
var button: Button = HudStyle.make_small_button("")
button.custom_minimum_size = Vector2(WIDTH, 46)
Expand Down
2 changes: 1 addition & 1 deletion game/ui/subtitle_line.gd
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@ const MIN_SECONDS: float = 1.5
const MAX_SECONDS: float = 8.0
const MAX_WAITING: int = 3
## Pixels from the bottom of the screen to the band's bottom: above the command card.
const BOTTOM_GAP: float = 236.0
const BOTTOM_GAP: float = 256.0
const FONT_SIZES: Dictionary[StringName, int] = {&"normal": 16, &"large": 22}
## The widest the text runs before it wraps.
const MAX_TEXT_WIDTH: float = 680.0
Expand Down
2 changes: 1 addition & 1 deletion tools/web_tests/deployment.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@ if (process.env.WEB_DEPLOYMENT_URL && !process.env.WEB_DEPLOYMENT_PUBLIC_ONLY) {
const landing = page.waitForEvent('console', {
predicate: entry => entry.text().includes('kessel_proving: 18 resource nodes and the bases placed'), timeout: 90000,
});
await page.mouse.click(850, 522, { delay: 80 });
await page.mouse.click(850, 572, { delay: 80 });
await landing;
await page.mouse.click(580, 385, { delay: 80 });
expect(await page.evaluate(() => window.farlanding.errors)).toEqual([]);
Expand Down
2 changes: 1 addition & 1 deletion tools/web_tests/game.spec.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -66,7 +66,7 @@ test('release starts on WebGL2 and uses real menu input', async ({ page }, info)
await page.screenshot({ path: info.outputPath('release-menu.png') });
await page.mouse.click(600, 285, { delay: 80 });
const landing = page.waitForEvent('console', { predicate: entry => entry.text().includes('kessel_proving: 18 resource nodes and the bases placed'), timeout: 90000 });
await page.mouse.click(850, 522, { delay: 80 });
await page.mouse.click(850, 572, { delay: 80 });
await landing;
await page.mouse.click(580, 385, { delay: 80 });
await page.screenshot({ path: info.outputPath('release-landing.png') });
Expand Down
Loading