Replaced the Nobile font with Cantarell, added a BOLD_SANS_FONT constant

This commit is contained in:
2020-12-02 17:25:48 -06:00
parent 9aa5dc7174
commit 791351f2f5
21 changed files with 179 additions and 132 deletions

View File

@@ -1,7 +1,8 @@
class IMICFPS class IMICFPS
GAME_ROOT_PATH = File.expand_path("..", File.dirname(__FILE__)) GAME_ROOT_PATH = File.expand_path("..", File.dirname(__FILE__))
SANS_SERIF_FONT = "#{GAME_ROOT_PATH}/static/fonts/Oxygen_Mono/OxygenMono-Regular.ttf" SANS_FONT = "#{GAME_ROOT_PATH}/static/fonts/Cantarell/Cantarell-Regular.otf"
BOLD_SANS_FONT = "#{GAME_ROOT_PATH}/static/fonts/Cantarell/Cantarell-Bold.otf"
MONOSPACE_FONT = "#{GAME_ROOT_PATH}/static/fonts/Oxygen_Mono/OxygenMono-Regular.ttf" MONOSPACE_FONT = "#{GAME_ROOT_PATH}/static/fonts/Oxygen_Mono/OxygenMono-Regular.ttf"
# Objects exported from blender using the default or meter object scale will be close to 1 GL unit # Objects exported from blender using the default or meter object scale will be close to 1 GL unit

View File

@@ -12,7 +12,7 @@ class IMICFPS
shadow_alpha: 0, shadow_alpha: 0,
shadow_color: Gosu::Color::WHITE, shadow_color: Gosu::Color::WHITE,
mode: :add, mode: :add,
font: SANS_SERIF_FONT font: SANS_FONT
) )
@last_message_time = 0 @last_message_time = 0

View File

@@ -13,7 +13,7 @@ class IMICFPS
"MATE\nTinyTanker\nOther Player Dude\nHuman 0xdeadbeef", "MATE\nTinyTanker\nOther Player Dude\nHuman 0xdeadbeef",
size: 18, size: 18,
mode: :add, mode: :add,
font: SANS_SERIF_FONT, font: SANS_FONT,
color: @color, color: @color,
shadow: true, shadow: true,
shadow_color: 0x88000000, shadow_color: 0x88000000,

View File

@@ -11,10 +11,10 @@ class IMICFPS
end end
title IMICFPS::NAME title IMICFPS::NAME
@subheading = Text.new("Loading Map: #{@map_parser.metadata.name}", y: 100, size: 50, alignment: :center, font: SANS_SERIF_FONT) @subheading = Text.new("Loading Map: #{@map_parser.metadata.name}", y: 100, size: 50, alignment: :center, font: SANS_FONT)
@description = Text.new("Map created by: #{@map_parser.metadata.authors.join(", ")}\n#{@map_parser.metadata.description}", y: 180, size: 24, alignment: :center, font: SANS_SERIF_FONT) @description = Text.new("Map created by: #{@map_parser.metadata.authors.join(", ")}\n#{@map_parser.metadata.description}", y: 180, size: 24, alignment: :center, font: SANS_FONT)
@state = Text.new("Preparing...", y: window.height/2-40, size: 40, alignment: :center, font: SANS_SERIF_FONT) @state = Text.new("Preparing...", y: window.height/2-40, size: 40, alignment: :center, font: SANS_FONT)
@percentage = Text.new("0%", y: window.height - 100 + 25, size: 50, alignment: :center, font: MONOSPACE_FONT) @percentage = Text.new("0%", y: window.height - 100 + 25, size: 50, alignment: :center, font: SANS_FONT)
@dummy_entity = nil @dummy_entity = nil
@assets = [] @assets = []

View File

@@ -1,8 +1,8 @@
class IMICFPS class IMICFPS
class MapEditorTool class MapEditorTool
class Editor < CyberarmEngine::GuiState class Editor < CyberarmEngine::GuiState
attr_reader :map attr_reader :map
def setup def setup
# TODO: Move everything required for a playable game map # TODO: Move everything required for a playable game map
# in to a Scene or Scene3D container object # in to a Scene or Scene3D container object

View File

@@ -20,27 +20,54 @@ class IMICFPS
@accent_color = ACCENT_COLOR @accent_color = ACCENT_COLOR
window.needs_cursor = true window.needs_cursor = true
@__version_text = CyberarmEngine::Text.new("<b>#{IMICFPS::NAME}</b> v#{IMICFPS::VERSION} (#{IMICFPS::RELEASE_NAME})", font: MONOSPACE_FONT) @__version_text = CyberarmEngine::Text.new("<b>#{IMICFPS::NAME}</b> v#{IMICFPS::VERSION} (#{IMICFPS::RELEASE_NAME})", font: BOLD_SANS_FONT)
@__version_text.x = window.width - (@__version_text.width + 10) @__version_text.x = window.width - (@__version_text.width + 10)
@__version_text.y = window.height - (@__version_text.height + 10) @__version_text.y = window.height - (@__version_text.height + 10)
super(*args) super(*args)
theme({ Label: { font: SANS_SERIF_FONT } }) theme(
{
Label:
{
font: SANS_FONT
},
Button:
{
font: BOLD_SANS_FONT,
background: [0xff222222, 0xff3A3A3E],
border_color: [0xaa_111111, 0xaa_000000],
border_thickness: 2,
text_align: :center,
# color: 0xffff8800,
color: 0xffffffff,
hover: {
background: [0xff444444, 0xff5A5A5E],
color: 0xffeeeeee
},
active: {
color: Gosu::Color::WHITE,
background: [0xff222222, 0xff1A1A1E]
}
}
}
)
end end
def title(text, color = Gosu::Color::BLACK) def title(text, color = Gosu::Color::BLACK)
@elements << Text.new(text, color: color, size: 100, x: 0, y: 15, font: SANS_SERIF_FONT) @elements << Text.new(text, color: color, size: 100, x: 0, y: 15, font: BOLD_SANS_FONT)
@_title = @elements.last @_title = @elements.last
end end
def subtitle(text, color = Gosu::Color::WHITE) def subtitle(text, color = Gosu::Color::WHITE)
@elements << Text.new(text, color: color, size: 50, x: 0, y: 100, font: SANS_SERIF_FONT) @elements << Text.new(text, color: color, size: 50, x: 0, y: 100, font: SANS_FONT)
@_subtitle = @elements.last @_subtitle = @elements.last
end end
def link(text, color = Gosu::Color.rgb(0,127,127), &block) def link(text, color = Gosu::Color.rgb(0,127,127), &block)
text = Text.new(text, color: color, size: 50, x: 0, y: 100 + (60 * @elements.count), font: SANS_SERIF_FONT) text = Text.new(text, color: color, size: 50, x: 0, y: 100 + (60 * @elements.count), font: BOLD_SANS_FONT)
@elements << Link.new(text, self, block) @elements << Link.new(text, self, block)
end end

View File

@@ -22,17 +22,17 @@
"lights":[ "lights":[
{ {
"type":"directional", "type":"point",
"intensity": 1, "intensity": 1,
"position": { "position": {
"x":30, "x":0,
"y":10, "y":100,
"z":30 "z":0
}, },
"diffuse": { "diffuse": {
"red":1, "red":1,
"green":1, "green":0.5,
"blue":1 "blue":0.1
}, },
"ambient": { "ambient": {
"red":0.5, "red":0.5,
@@ -46,17 +46,17 @@
} }
}, },
{ {
"type":"point", "type": "directional",
"intensity": 1, "intensity": 1,
"position": { "position": {
"x":0, "x": 30,
"y":100, "y": 10,
"z":0 "z": 30
}, },
"diffuse": { "diffuse": {
"red": 1, "red": 1,
"green":0.5, "green": 1,
"blue":0.1 "blue": 1
}, },
"ambient": { "ambient": {
"red": 0.5, "red": 0.5,

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

Binary file not shown.

View File

@@ -1,4 +1,4 @@
Copyright (c) 2010-2012, Vernon Adams (vern@newtypography.co.uk), with Reserved Font Name Nobile. Copyright (c) 2009--2019, The Cantarell Authors
This Font Software is licensed under the SIL Open Font License, Version 1.1. 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: This license is copied below, and is also available with a FAQ at:
@@ -91,3 +91,22 @@ INCLUDING ANY GENERAL, SPECIAL, INDIRECT, INCIDENTAL, OR CONSEQUENTIAL
DAMAGES, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING 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 FROM, OUT OF THE USE OR INABILITY TO USE THE FONT SOFTWARE OR FROM
OTHER DEALINGS IN THE FONT SOFTWARE. OTHER DEALINGS IN THE FONT SOFTWARE.
-------------------------------------------------------------------------------
Scripts contain parts of the source code of glyphsLib:
# Copyright 2015 Google Inc. All Rights Reserved.
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

Binary file not shown.