diff --git a/Game/assets/fonts/OFL-Orbitron.txt b/Game/assets/fonts/OFL-Orbitron.txt new file mode 100644 index 00000000..91ede459 --- /dev/null +++ b/Game/assets/fonts/OFL-Orbitron.txt @@ -0,0 +1,93 @@ +Copyright 2018 The Orbitron Project Authors (https://github.com/theleagueof/orbitron), with Reserved Font Name: "Orbitron" + +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 + + +----------------------------------------------------------- +SIL OPEN FONT LICENSE Version 1.1 - 26 February 2007 +----------------------------------------------------------- + +PREAMBLE +The goals of the Open Font License (OFL) are to stimulate worldwide +development of collaborative font projects, to support the font creation +efforts of academic and linguistic communities, and to provide a free and +open framework in which fonts may be shared and improved in partnership +with others. + +The OFL allows the licensed fonts to be used, studied, modified and +redistributed freely as long as they are not sold by themselves. The +fonts, including any derivative works, can be bundled, embedded, +redistributed and/or sold with any software provided that any reserved +names are not used by derivative works. The fonts and derivatives, +however, cannot be released under any other type of license. The +requirement for fonts to remain under this license does not apply +to any document created using the fonts or their derivatives. + +DEFINITIONS +"Font Software" refers to the set of files released by the Copyright +Holder(s) under this license and clearly marked as such. This may +include source files, build scripts and documentation. + +"Reserved Font Name" refers to any names specified as such after the +copyright statement(s). + +"Original Version" refers to the collection of Font Software components as +distributed by the Copyright Holder(s). + +"Modified Version" refers to any derivative made by adding to, deleting, +or substituting -- in part or in whole -- any of the components of the +Original Version, by changing formats or by porting the Font Software to a +new environment. + +"Author" refers to any designer, engineer, programmer, technical +writer or other person who contributed to the Font Software. + +PERMISSION & CONDITIONS +Permission is hereby granted, free of charge, to any person obtaining +a copy of the Font Software, to use, study, copy, merge, embed, modify, +redistribute, and sell modified and unmodified copies of the Font +Software, subject to the following conditions: + +1) Neither the Font Software nor any of its individual components, +in Original or Modified Versions, may be sold by itself. + +2) Original or Modified Versions of the Font Software may be bundled, +redistributed and/or sold with any software, provided that each copy +contains the above copyright notice and this license. These can be +included either as stand-alone text files, human-readable headers or +in the appropriate machine-readable metadata fields within text or +binary files as long as those fields can be easily viewed by the user. + +3) No Modified Version of the Font Software may use the Reserved Font +Name(s) unless explicit written permission is granted by the corresponding +Copyright Holder. This restriction only applies to the primary font name as +presented to the users. + +4) The name(s) of the Copyright Holder(s) or the Author(s) of the Font +Software shall not be used to promote, endorse or advertise any +Modified Version, except to acknowledge the contribution(s) of the +Copyright Holder(s) and the Author(s) or with their explicit written +permission. + +5) The Font Software, modified or unmodified, in part or in whole, +must be distributed entirely under this license, and must not be +distributed under any other license. The requirement for fonts to +remain under this license does not apply to any document created +using the Font Software. + +TERMINATION +This license becomes null and void if any of the above conditions are +not met. + +DISCLAIMER +THE FONT SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO ANY WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT +OF COPYRIGHT, PATENT, TRADEMARK, OR OTHER RIGHT. IN NO EVENT SHALL THE +COPYRIGHT HOLDER BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, +INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL +DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING +FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM +OTHER DEALINGS IN THE FONT SOFTWARE. diff --git a/Game/assets/fonts/Orbitron-Medium.ttf b/Game/assets/fonts/Orbitron-Medium.ttf new file mode 100644 index 00000000..91287a30 Binary files /dev/null and b/Game/assets/fonts/Orbitron-Medium.ttf differ diff --git a/Game/assets/fonts/Orbitron-Medium.ttf.import b/Game/assets/fonts/Orbitron-Medium.ttf.import new file mode 100644 index 00000000..7095b685 --- /dev/null +++ b/Game/assets/fonts/Orbitron-Medium.ttf.import @@ -0,0 +1,36 @@ +[remap] + +importer="font_data_dynamic" +type="FontFile" +uid="uid://bhbpb712ouagv" +path="res://.godot/imported/Orbitron-Medium.ttf-0d3cd88166f12a3096066c2eef570744.fontdata" + +[deps] + +source_file="res://assets/fonts/Orbitron-Medium.ttf" +dest_files=["res://.godot/imported/Orbitron-Medium.ttf-0d3cd88166f12a3096066c2eef570744.fontdata"] + +[params] + +Rendering=null +antialiasing=1 +generate_mipmaps=false +disable_embedded_bitmaps=true +multichannel_signed_distance_field=false +msdf_pixel_range=8 +msdf_size=48 +allow_system_fallback=true +force_autohinter=false +modulate_color_glyphs=false +hinting=3 +subpixel_positioning=4 +keep_rounding_remainders=true +oversampling=0.0 +Fallbacks=null +fallbacks=[] +Compress=null +compress=true +preload=[] +language_support={} +script_support={} +opentype_features={} diff --git a/Game/scenes/HUD.tscn b/Game/scenes/HUD.tscn index 8624f321..70104c34 100644 --- a/Game/scenes/HUD.tscn +++ b/Game/scenes/HUD.tscn @@ -1,9 +1,10 @@ -[gd_scene load_steps=9 format=3 uid="uid://c8kak2l3m4n5"] +[gd_scene load_steps=10 format=3 uid="uid://c8kak2l3m4n5"] [ext_resource type="Script" uid="uid://du7y176h5aaq4" path="res://scripts/HUDController.gd" id="1_hud_controller"] [ext_resource type="Script" path="res://scripts/hud_attitude_indicator.gd" id="2_adi"] [ext_resource type="Script" path="res://scripts/hud_heading_tape.gd" id="3_tape"] [ext_resource type="Script" path="res://scripts/hud_gauge.gd" id="4_gauge"] +[ext_resource type="Theme" path="res://themes/hud_theme.tres" id="5_theme"] [sub_resource type="LabelSettings" id="LabelSettings_hud"] font_size = 32 @@ -50,6 +51,7 @@ anchor_bottom = 1.0 grow_horizontal = 2 grow_vertical = 2 mouse_filter = 2 +theme = ExtResource("5_theme") [node name="ScoreboardPanel" type="PanelContainer" parent="Control"] layout_mode = 1 diff --git a/Game/scripts/hud_attitude_indicator.gd b/Game/scripts/hud_attitude_indicator.gd index b19dfba3..66a40b3e 100644 --- a/Game/scripts/hud_attitude_indicator.gd +++ b/Game/scripts/hud_attitude_indicator.gd @@ -73,7 +73,7 @@ func _draw() -> void: draw_line(Vector2(-half_chord, horizon_y), Vector2(half_chord, horizon_y), LINE_COLOR, 2.0) # Pitch ladder: rungs every 10 degrees, labelled, scrolling with pitch. - var font := ThemeDB.fallback_font + var font := hud_font() for ladder_deg: int in [-30, -20, -10, 10, 20, 30]: var y := horizon_y - ladder_deg * px_per_deg if absf(y) > radius - 12.0: diff --git a/Game/scripts/hud_gauge.gd b/Game/scripts/hud_gauge.gd index 55cc9290..c0e1811c 100644 --- a/Game/scripts/hud_gauge.gd +++ b/Game/scripts/hud_gauge.gd @@ -37,7 +37,7 @@ func _process(delta: float) -> void: func _draw() -> void: - var font := ThemeDB.fallback_font + var font := hud_font() var fraction := clampf(_value / max_value, 0.0, 1.0) var reading := value_format % _value diff --git a/Game/scripts/hud_heading_tape.gd b/Game/scripts/hud_heading_tape.gd index 858b6151..61178739 100644 --- a/Game/scripts/hud_heading_tape.gd +++ b/Game/scripts/hud_heading_tape.gd @@ -39,7 +39,7 @@ func _process(delta: float) -> void: func _draw() -> void: - var font := ThemeDB.fallback_font + var font := hud_font() var center_x := size.x / 2.0 var px_per_deg := size.x / VISIBLE_RANGE diff --git a/Game/scripts/hud_instrument.gd b/Game/scripts/hud_instrument.gd index 4817c976..1b572b4a 100644 --- a/Game/scripts/hud_instrument.gd +++ b/Game/scripts/hud_instrument.gd @@ -23,3 +23,11 @@ static func angle_delta_deg(from: float, to: float) -> float: func _smoothing_weight(delta: float) -> float: return 1.0 - exp(-SMOOTHING * delta) # frame-rate independent + + +# Procedural draw calls do not automatically consume a Control's theme font; +# resolve it explicitly so every instrument uses the same packaged typeface +# as ordinary Labels instead of ThemeDB's debug-looking fallback. +func hud_font() -> Font: + var font := get_theme_default_font() + return font if font else ThemeDB.fallback_font diff --git a/Game/themes/hud_theme.tres b/Game/themes/hud_theme.tres new file mode 100644 index 00000000..0c4f0e4d --- /dev/null +++ b/Game/themes/hud_theme.tres @@ -0,0 +1,29 @@ +[gd_resource type="Theme" load_steps=3 format=3] + +[ext_resource type="FontFile" path="res://assets/fonts/Orbitron-Medium.ttf" id="1_font"] + +[sub_resource type="StyleBoxFlat" id="StyleBoxFlat_panel"] +bg_color = Color(0.035, 0.05, 0.085, 0.76) +border_width_left = 1 +border_width_top = 1 +border_width_right = 1 +border_width_bottom = 1 +border_color = Color(0.3, 0.7, 1, 0.38) +corner_radius_top_left = 8 +corner_radius_top_right = 8 +corner_radius_bottom_right = 8 +corner_radius_bottom_left = 8 +content_margin_left = 12.0 +content_margin_top = 8.0 +content_margin_right = 12.0 +content_margin_bottom = 8.0 + +[resource] +default_font = ExtResource("1_font") +default_font_size = 14 +Label/colors/font_color = Color(0.86, 0.94, 1, 1) +Label/colors/font_shadow_color = Color(0, 0, 0, 0.72) +Label/constants/outline_size = 1 +Label/constants/shadow_offset_x = 2 +Label/constants/shadow_offset_y = 2 +PanelContainer/styles/panel = SubResource("StyleBoxFlat_panel") diff --git a/TODO.md b/TODO.md index 2e393d53..554cc161 100644 --- a/TODO.md +++ b/TODO.md @@ -22,7 +22,7 @@ The largest gap between this and a AAA-feeling product is presentation, not code - [x] Goal celebration sequence: goal burst, team-tinted flash/title card, dedicated camera cut and slow-motion beat after authoritative score registration and before reset/kickoff. - [x] Local lighting / dynamic GI — four local pitch lights plus SDFGI provide bounce and contact lighting for the runtime-generated arena shell; the shader's `hull_fill` stand-in is retired. (The shell is generated in `_ready`, so it cannot participate in an editor LightmapGI bake.) - [x] Dress `arena_03` — its asteroid field now has mining stations, debris clusters and a distant planet. -- [ ] Custom font + a real `Theme` resource for the HUD. The procedural instruments are well-engineered, but `ThemeDB.fallback_font` at 10-13 px reads as a debug overlay. +- [x] Custom font + a real `Theme` resource for the HUD. Packaged Orbitron typography, shared label styling and themed procedural-instrument text replace `ThemeDB.fallback_font`. - [ ] Post-processing beyond glow: DoF, motion blur, vignette, chromatic aberration on turbo. ## Multiplayer (long term)