Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix fallout from SimpleGraphic upgrade with wider Unicode support #7586

Draft
wants to merge 5 commits into
base: dev
Choose a base branch
from
Draft
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
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1,167 changes: 6 additions & 1,161 deletions runtime/SimpleGraphic/Fonts/Bitstream Vera Sans Mono.tgf

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
1,179 changes: 18 additions & 1,161 deletions runtime/SimpleGraphic/Fonts/Liberation Sans Bold.tgf

Large diffs are not rendered by default.

Binary file removed runtime/SimpleGraphic/Fonts/Liberation Sans.10.tga
Binary file not shown.
Binary file removed runtime/SimpleGraphic/Fonts/Liberation Sans.12.tga
Binary file not shown.
Binary file removed runtime/SimpleGraphic/Fonts/Liberation Sans.14.tga
Binary file not shown.
Binary file removed runtime/SimpleGraphic/Fonts/Liberation Sans.16.tga
Binary file not shown.
Binary file not shown.
Binary file removed runtime/SimpleGraphic/Fonts/Liberation Sans.20.tga
Binary file not shown.
Binary file removed runtime/SimpleGraphic/Fonts/Liberation Sans.24.tga
Binary file not shown.
Binary file removed runtime/SimpleGraphic/Fonts/Liberation Sans.28.tga
Binary file not shown.
Binary file not shown.
1,179 changes: 18 additions & 1,161 deletions runtime/SimpleGraphic/Fonts/Liberation Sans.tgf

Large diffs are not rendered by default.

Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added runtime/SimpleGraphic/Fonts/NotoSans-Bold.ttf
Binary file not shown.
Binary file added runtime/SimpleGraphic/Fonts/NotoSans-Regular.ttf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added runtime/SimpleGraphic/Fonts/NotoSansJP-Bold.ttf
Binary file not shown.
Binary file not shown.
Binary file added runtime/SimpleGraphic/Fonts/NotoSansKR-Bold.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added runtime/SimpleGraphic/Fonts/NotoSansSC-Bold.otf
Binary file not shown.
Binary file not shown.
Binary file added runtime/SimpleGraphic/Fonts/NotoSansTC-Bold.otf
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file not shown.
Binary file added runtime/SimpleGraphic/Fonts/NotoSansThai-Bold.ttf
Binary file not shown.
Binary file not shown.
93 changes: 93 additions & 0 deletions runtime/SimpleGraphic/Fonts/OFL.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,93 @@
Copyright 2012 Google Inc. All Rights Reserved.

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.
31 changes: 8 additions & 23 deletions src/Classes/EditControl.lua
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@ local m_max = math.max
local m_min = math.min
local m_floor = math.floor
local protected_replace = "*"
local utf8 = require('lua-utf8')

local function lastLine(str)
local lastLineIndex = 1
Expand Down Expand Up @@ -541,18 +542,10 @@ function EditClass:OnKeyDown(key, doubleClick)
if self.caret > 1 then
if ctrl then
-- Skip leading space, then jump word
while self.buf:sub(self.caret-1, self.caret-1):match("[%s%p]") do
if self.caret > 1 then
self.caret = self.caret - 1
end
end
while self.buf:sub(self.caret-1, self.caret-1):match("%w") do
if self.caret > 1 then
self.caret = self.caret - 1
end
end
self.caret = self.caret - #utf8.match(self.buf:sub(1, self.caret-1), "[%s%p]*$")
self.caret = self.caret - #utf8.match(self.buf:sub(1, self.caret-1), "%w*$")
else
self.caret = self.caret - 1
self.caret = utf8.next(self.buf, self.caret, -1) or 0
end
self.lastUndoState.caret = self.caret
self:ScrollCaretIntoView()
Expand All @@ -562,19 +555,11 @@ function EditClass:OnKeyDown(key, doubleClick)
self.sel = shift and (self.sel or self.caret) or nil
if self.caret <= #self.buf then
if ctrl then
-- Jump word, then skip trailing space,
while self.buf:sub(self.caret, self.caret):match("%w") do
if self.caret <= #self.buf then
self.caret = self.caret + 1
end
end
while self.buf:sub(self.caret, self.caret):match("[%s%p]") do
if self.caret <= #self.buf then
self.caret = self.caret + 1
end
end
-- Jump word, then skip trailing space,
self.caret = self.caret + #utf8.match(self.buf:sub(self.caret), "^%w*")
self.caret = self.caret + #utf8.match(self.buf:sub(self.caret), "^[%s%p]*")
else
self.caret = self.caret + 1
self.caret = utf8.next(self.buf, self.caret, 1) or #self.buf + 1
end
self.lastUndoState.caret = self.caret
self:ScrollCaretIntoView()
Expand Down
2 changes: 1 addition & 1 deletion src/Classes/TradeQuery.lua
Original file line number Diff line number Diff line change
Expand Up @@ -427,7 +427,7 @@ Highest Weight - Displays the order retrieved from trade]]
t_insert(slotTables, { slotName = self.itemsTab.sockets[nodeId].label, nodeId = nodeId })
end

self.controls.sectionAnchor = new("LabelControl", { "LEFT", self.controls.poesessidButton, "LEFT" }, 0, 0, 0, 0, "")
self.controls.sectionAnchor = new("Control", { "LEFT", self.controls.poesessidButton, "LEFT" }, 0, 0, 0, 0)
top_pane_alignment_ref = {"TOPLEFT", self.controls.sectionAnchor, "TOPLEFT"}
local scrollBarShown = #activeSocketList > 6 -- clipping start at Socket 7
-- dynamically hide rows that are above or below the scrollBar
Expand Down
12 changes: 7 additions & 5 deletions src/Modules/Common.lua
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@ common.curl = require("lcurl.safe")
common.xml = require("xml")
common.base64 = require("base64")
common.sha1 = require("sha1")
local utf8 = require('lua-utf8')

-- Try to load a library return nil if failed. https://stackoverflow.com/questions/34965863/lua-require-fallback-error-handling
function prerequire(...)
Expand Down Expand Up @@ -657,20 +658,21 @@ function formatNumSep(str)
end
local x, y, minus, integer, fraction = str:find("(-?)(%d+)(%.?%d*)")
if main.showThousandsSeparators then
integer = integer:reverse():gsub("(%d%d%d)", "%1"..main.thousandsSeparator):reverse()
rev1kSep = utf8.reverse(main.thousandsSeparator)
integer = utf8.reverse(utf8.gsub(utf8.reverse(integer), "(%d%d%d)", "%1"..rev1kSep))
-- There will be leading separators if the number of digits are divisible by 3
-- This checks for their presence and removes them
-- Don't use patterns here because thousandsSeparator can be a pattern control character, and will crash if used
if main.thousandsSeparator ~= "" then
local thousandsSeparator = string.find(integer, main.thousandsSeparator, 1, 2)
local thousandsSeparator = utf8.find(integer, rev1kSep, 1, 2)
if thousandsSeparator and thousandsSeparator == 1 then
integer = integer:sub(2)
integer = utf8.sub(integer, 2)
end
end
else
integer = integer:reverse():gsub("(%d%d%d)", "%1"):reverse()
integer = utf8.reverse(utf8.gsub(utf8.reverse(integer), "(%d%d%d)", "%1"))
end
return colour..minus..integer..fraction:gsub("%.", main.decimalSeparator)
return colour..minus..integer..utf8.gsub(fraction, "%.", main.decimalSeparator)
end)
end

Expand Down
Binary file modified src/TreeData/PSPointsFrame.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file modified src/TreeData/PSStartNodeBackgroundInactive.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
4 changes: 2 additions & 2 deletions src/UpdateCheck.lua
Original file line number Diff line number Diff line change
Expand Up @@ -78,8 +78,8 @@ end

ConPrintf("Checking for update...")

local scriptPath = GetScriptPath()
local runtimePath = GetRuntimePath()
local scriptPath = "."
local runtimePath = "."

-- Load and process local manifest
local localVer
Expand Down
Loading