Skip to content

Commit

Permalink
Use font with better language support
Browse files Browse the repository at this point in the history
  • Loading branch information
fleskesvor committed May 15, 2018
1 parent 9ade672 commit 28a309f
Show file tree
Hide file tree
Showing 7 changed files with 187 additions and 26 deletions.
4 changes: 4 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -50,3 +50,7 @@ as described in the LICENSE.md file.
License CC0, [distributed on OpenGameArt](http://opengameart.org/content/cartoon-characters-and-objects-vector-pack)
- [Clint Bellanger](http://clintbellanger.net) - Recycle items set, License CC BY 3.0,
[distributed on OpenGameArt](http://opengameart.org/content/recycle-items-set)

### Font

The [Noto font](https://www.google.com/get/noto/) is a trademark of Google Inc., and is available under the SIL Open Font License, version 1.1.
59 changes: 40 additions & 19 deletions device/demo/ui/dd_default.tscn
Original file line number Diff line number Diff line change
@@ -1,10 +1,24 @@
[gd_scene load_steps=4 format=2]
[gd_scene load_steps=7 format=2]

[ext_resource path="res://globals/dialog_dialog.gd" type="Script" id=1]

[sub_resource type="Animation" id=1]
[sub_resource type="DynamicFontData" id=1]

font_path = "res://ui/fonts/NotoSans-Regular.ttf"

[sub_resource type="DynamicFont" id=2]

size = 12
use_mipmaps = false
use_filter = false
font_data = SubResource( 1 )

[sub_resource type="Theme" id=3]

default_font = SubResource( 2 )

[sub_resource type="Animation" id=4]

resource_name = "hide"
length = 0.75
loop = false
step = 0.05
Expand Down Expand Up @@ -33,7 +47,7 @@ tracks/1/keys = {
"values": [ Vector2( 1, 1 ), Vector2( 1, 1.1 ), Vector2( 1, 1.1 ), Vector2( 1, 0 ) ]
}

[sub_resource type="Animation" id=2]
[sub_resource type="Animation" id=5]

length = 0.75
loop = false
Expand Down Expand Up @@ -75,7 +89,7 @@ tracks/2/keys = {
"values": [ true ]
}

[node name="dialog" type="Control" index="0"]
[node name="dialog" type="Control"]

anchor_left = 0.0
anchor_top = 0.0
Expand All @@ -100,20 +114,30 @@ mouse_enter_shadow_color = Color( 0.6, 0.4, 0, 1 )
mouse_exit_color = Color( 1, 1, 1, 1 )
mouse_exit_shadow_color = Color( 1, 1, 1, 1 )

[node name="anchor" type="Node2D" parent="." index="0"]
[node name="anchor" type="CenterContainer" parent="." index="0"]

position = Vector2( 373.302, 425.803 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
use_top_left = false

[node name="bg" type="TextureRect" parent="anchor" index="0"]

anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = -937.0
margin_top = -377.0
margin_right = 985.0
margin_bottom = 138.0
margin_left = 814.0
margin_top = 114.0
margin_right = 814.0
margin_bottom = 114.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 1
Expand All @@ -129,10 +153,8 @@ anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
margin_left = -735.0
margin_top = -334.0
margin_right = 893.0
margin_bottom = -105.0
margin_right = 1628.0
margin_bottom = 229.0
rect_min_size = Vector2( 1628, 229 )
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = true
Expand Down Expand Up @@ -223,8 +245,7 @@ mouse_filter = 2
mouse_default_cursor_shape = 0
size_flags_horizontal = 2
size_flags_vertical = 0
custom_colors/font_color = Color( 1, 1, 1, 1 )
custom_colors/font_color_shadow = Color( 0, 0, 0, 1 )
theme = SubResource( 3 )
text = "I should pick option one"
valign = 1
autowrap = true
Expand All @@ -239,8 +260,8 @@ autoplay = ""
playback_process_mode = 1
playback_default_blend_time = 0.0
playback_speed = 1.0
anims/hide = SubResource( 1 )
anims/show = SubResource( 2 )
anims/hide = SubResource( 4 )
anims/show = SubResource( 5 )
blend_times = [ ]


Original file line number Diff line number Diff line change
@@ -1,9 +1,31 @@
[gd_scene load_steps=2 format=2]
[gd_scene load_steps=5 format=2]

[ext_resource path="res://globals/dialog_instance.gd" type="Script" id=1]
[ext_resource path="res://ui/fonts/NotoSans-Regular.ttf" type="DynamicFontData" id=2]

[node name="dialog_instance" type="Container"]
[sub_resource type="DynamicFont" id=1]

size = 12
use_mipmaps = false
use_filter = false
font_data = ExtResource( 2 )

[sub_resource type="Theme" id=2]

default_font = SubResource( 1 )

[node name="dialog_instance" type="Container" index="0"]

anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1
script = ExtResource( 1 )
__meta__ = {
"__editor_plugin_screen__": "2D"
Expand All @@ -14,8 +36,20 @@ fixed_pos = false

[node name="anchor" type="Container" parent="." index="0"]

anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
anchor_bottom = 0.0
rect_pivot_offset = Vector2( 0, 0 )
rect_clip_content = false
mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 1
size_flags_vertical = 1

[node name="text" type="RichTextLabel" parent="anchor" index="0"]

modulate = Color( 0, 0, 0, 1 )
anchor_left = 0.0
anchor_top = 0.0
anchor_right = 0.0
Expand All @@ -30,10 +64,8 @@ mouse_filter = 0
mouse_default_cursor_shape = 0
size_flags_horizontal = 2
size_flags_vertical = 2
custom_colors/default_color = Color( 0, 0, 0, 1 )
custom_colors/font_color_selected = Color( 0, 0, 0, 1 )
custom_constants/line_separation = -5
bbcode_enabled = false
theme = SubResource( 2 )
bbcode_enabled = true
bbcode_text = ""
visible_characters = -1
percent_visible = 1.0
Expand Down
3 changes: 2 additions & 1 deletion device/ui/dialog_player.tscn
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
[gd_scene load_steps=3 format=2]

[ext_resource path="res://ui/dialog_default.tscn" type="PackedScene" id=1]
[ext_resource path="res://demo/ui/dialog_default.tscn" type="PackedScene" id=1]
[ext_resource path="res://globals/dialog_player.gd" type="Script" id=2]


[node name="dialog_player" type="ResourcePreloader"]

resources = [ PoolStringArray( "default" ), [ ExtResource( 1 ) ] ]
Expand Down
92 changes: 92 additions & 0 deletions device/ui/fonts/LICENSE_OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,92 @@
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.
Binary file added device/ui/fonts/NotoSans-Regular.ttf
Binary file not shown.
11 changes: 11 additions & 0 deletions device/ui/fonts/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,11 @@
This package is part of the noto project. Visit
google.com/get/noto for more information.

Built on 2017-10-24 from the following noto repository:
-----
Repo: noto-fonts
Tag: v2017-10-24-phase3-second-cleanup
Date: 2017-10-24 12:10:34 GMT
Commit: 8ef14e6c606a7a0ef3943b9ca01fd49445620d79

Remove some files that aren't for release.

0 comments on commit 28a309f

Please sign in to comment.