Skip to content

Commit

Permalink
Merge pull request #16424 from schlawg/ui-font-cleanup
Browse files Browse the repository at this point in the history
UI font cleanup
  • Loading branch information
ornicar authored Nov 17, 2024
2 parents e2fb7da + ab14fa8 commit 9b0354a
Show file tree
Hide file tree
Showing 11 changed files with 777 additions and 803 deletions.
18 changes: 14 additions & 4 deletions bin/gen/licon.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def main():

gen_fonts()

codes = parse_codes()
codes = read_write_codes()

gen_sources(codes)

Expand All @@ -110,23 +110,33 @@ def dash_camel(s):
return ''.join([w.title() for w in s.split('-')])


def parse_codes():
def read_write_codes():
unnamed_re = re.compile(r'$|uni[a-f0-9]{4}', re.IGNORECASE)
codes = {}
warnings = []
corrected = []
lines = []
with open('lichess.sfd', 'r') as f:
lines = f.readlines()
name = None
n = 0
for line in lines:
if line.startswith('StartChar:'):
name = dash_camel(line.split(': ')[1].strip())
elif line.startswith('Encoding:') and name is not None:
code_point = int(line.split(' ')[1])
if code_point >= 0xe000 and code_point <= 0xefff:
n += 1
code_point = 57343 + n
line = f'Encoding: {code_point} {code_point} {n}\n'
if unnamed_re.match(name):
warnings.append(f' Unnamed glyph "{name}" at code point {code_point}\n')
continue
codes[name] = code_point
else:
codes[name] = code_point
corrected.append(line)
if corrected != lines:
with open('lichess.sfd', 'w') as f:
f.write(''.join(corrected))
print('' if not warnings else f'\nWarnings:\n{"".join(warnings)}')
return dict(sorted(codes.items(), key=lambda x: x[1]))

Expand Down
241 changes: 120 additions & 121 deletions modules/ui/src/main/Icon.scala
Original file line number Diff line number Diff line change
Expand Up @@ -19,128 +19,127 @@ object Icon:
given scalalib.Iso.StringIso[Icon] = scalalib.Iso.string(apply, value)
import play.api.libs.json.{ Writes, JsString }
given iconWrites: Writes[Icon] = icon => JsString(Icon.value(icon))
val Tools: Icon = "" // e000
val Bullseye: Icon = "" // e001
val Agent: Icon = "" // e002
val Mic: Icon = "" // e003
val BarChart: Icon = "" // e004
val InfoCircle: Icon = "" // e005
val ScreenDesktop: Icon = "" // e006
val PhoneMobile: Icon = "" // e007
val Multiboard: Icon = "" // e008
val HeartOutline: Icon = "" // e009
val FlagRacingKings: Icon = "" // e00a
val Crazyhouse: Icon = "" // e00b
val Tshirt: Icon = "" // e00c
val Heart: Icon = "" // e00d
val RadioTower: Icon = "" // e00e
val BellOutline: Icon = "" // e00f
val Disc: Icon = "" // e010
val Wings: Icon = "" // e011
val DiscOutline: Icon = "" // e012
val Handset: Icon = "" // e013
val ArrowThruApple: Icon = "" // e014
val CautionTriangle: Icon = "" // e015
val Link: Icon = "" // e016
val Rabbit: Icon = "" // e017
val NodeBranching: Icon = "" // e018
val Gear: Icon = "" // e019
val Reload: Icon = "" // e01a
val DieSix: Icon = "" // e01b
val FlagKingHill: Icon = "" // e01c
val FlameBlitz: Icon = "" // e01d
val Feather: Icon = "" // e01e
val Turtle: Icon = "" // e01f
val FlagChessboard: Icon = "" // e020
val ArcheryTarget: Icon = "" // e021
val ThreeCheckStack: Icon = "" // e022
val UploadCloud: Icon = "" // e023
val ExternalArrow: Icon = "" // e024
val AnalogTv: Icon = "" // e025
val RssFeed: Icon = "" // e026
val StudyBoard: Icon = "" // e027
val Shield: Icon = "" // e028
val InkQuill: Icon = "" // e029
val Target: Icon = "" // e02a
val Crown: Icon = "" // e02b
val LineGraph: Icon = "" // e02c
val GraduateCap: Icon = "" // e02d
val PaperAirplane: Icon = "" // e02e
val ZoomIn: Icon = "" // e02f
val Expand: Icon = "" // e030
val Atom: Icon = "" // e031
val List: Icon = "" // e032
val Antichess: Icon = "" // e033
val Microscope: Icon = "" // e034
val ChasingArrows: Icon = "" // e035
val CrownElite: Icon = "" // e036
val Funnel: Icon = "" // e037
val Checkmark: Icon = "" // e038
val InternalArrow: Icon = "" // e039
val PlayTriangle: Icon = "" // e03a
val GreaterThan: Icon = "" // e03b
val LessThan: Icon = "" // e03c
val DiscBig: Icon = "" // e03d
val DiscBigOutline: Icon = "" // e03e
val X: Icon = "" // e03f
val ArrowDownRight: Icon = "" // e040
val ArrowUpRight: Icon = "" // e041
val PlusButton: Icon = "" // e042
val MinusButton: Icon = "" // e043
val Fire: Icon = "" // e044
val DownTriangle: Icon = "" // e045
val UpTriangle: Icon = "" // e046
val Bullet: Icon = "" // e047
val Swords: Icon = "" // e048
val JumpLast: Icon = "" // e049
val JumpFirst: Icon = "" // e04a
val JumpNext: Icon = "" // e04b
val JumpPrev: Icon = "" // e04c
val Pause: Icon = "" // e04d
val Hamburger: Icon = "" // e04e
val Globe: Icon = "" // e04f
val Book: Icon = "" // e050
val BarGraph: Icon = "" // e051
val Keypad: Icon = "" // e052
val Berserk: Icon = "" // e053
val Padlock: Icon = "" // e054
val FlagOutline: Icon = "" // e055
val BubbleSpeech: Icon = "" // e056
val BubbleConvo: Icon = "" // e057
val Envelope: Icon = "" // e058
val Group: Icon = "" // e059
val Trophy: Icon = "" // e05a
val ThumbsUp: Icon = "" // e05b
val Back: Icon = "" // e05c
val CautionCircle: Icon = "" // e05d
val NotAllowed: Icon = "" // e05e
val RandomColor: Icon = "" // e05f
val Pencil: Icon = "" // e060
val Cogs: Icon = "" // e061
val Tag: Icon = "" // e062
val Clock: Icon = "" // e063
val Trash: Icon = "" // e064
val User: Icon = "" // e065
val StarOutline: Icon = "" // e066
val Star: Icon = "" // e067
val MoreTriangle: Icon = "" // e068
val Eye: Icon = "" // e069
val Power: Icon = "" // e06a
val Download: Icon = "" // e06b
val Search: Icon = "" // e06c
val Forward: Icon = "" // e06d
val UltraBullet: Icon = "" // e06e
val Storm: Icon = "" // e06f
val CautionTriangle: Icon = "" // e000
val Link: Icon = "" // e001
val Rabbit: Icon = "" // e002
val ShareIos: Icon = "" // e003
val ShareAndroid: Icon = "" // e004
val Gear: Icon = "" // e005
val DieSix: Icon = "" // e006
val FlagKingHill: Icon = "" // e007
val FlameBlitz: Icon = "" // e008
val Feather: Icon = "" // e009
val Turtle: Icon = "" // e00a
val FlagChessboard: Icon = "" // e00b
val ArcheryTarget: Icon = "" // e00c
val ThreeCheckStack: Icon = "" // e00d
val UploadCloud: Icon = "" // e00e
val ExternalArrow: Icon = "" // e00f
val AnalogTv: Icon = "" // e010
val RssFeed: Icon = "" // e011
val StudyBoard: Icon = "" // e012
val Shield: Icon = "" // e013
val InkQuill: Icon = "" // e014
val Target: Icon = "" // e015
val Crown: Icon = "" // e016
val LineGraph: Icon = "" // e017
val GraduateCap: Icon = "" // e018
val PaperAirplane: Icon = "" // e019
val ZoomIn: Icon = "" // e01a
val Expand: Icon = "" // e01b
val Atom: Icon = "" // e01c
val List: Icon = "" // e01d
val Antichess: Icon = "" // e01e
val Microscope: Icon = "" // e01f
val ChasingArrows: Icon = "" // e020
val CrownElite: Icon = "" // e021
val Funnel: Icon = "" // e022
val Checkmark: Icon = "" // e023
val InternalArrow: Icon = "" // e024
val PlayTriangle: Icon = "" // e025
val GreaterThan: Icon = "" // e026
val LessThan: Icon = "" // e027
val DiscBig: Icon = "" // e028
val DiscBigOutline: Icon = "" // e029
val X: Icon = "" // e02a
val ArrowDownRight: Icon = "" // e02b
val ArrowUpRight: Icon = "" // e02c
val PlusButton: Icon = "" // e02d
val MinusButton: Icon = "" // e02e
val Fire: Icon = "" // e02f
val DownTriangle: Icon = "" // e030
val UpTriangle: Icon = "" // e031
val Bullet: Icon = "" // e032
val Swords: Icon = "" // e033
val JumpLast: Icon = "" // e034
val JumpFirst: Icon = "" // e035
val JumpNext: Icon = "" // e036
val JumpPrev: Icon = "" // e037
val Pause: Icon = "" // e038
val Hamburger: Icon = "" // e039
val Globe: Icon = "" // e03a
val Book: Icon = "" // e03b
val BarGraph: Icon = "" // e03c
val Keypad: Icon = "" // e03d
val Berserk: Icon = "" // e03e
val Padlock: Icon = "" // e03f
val FlagOutline: Icon = "" // e040
val BubbleSpeech: Icon = "" // e041
val BubbleConvo: Icon = "" // e042
val Envelope: Icon = "" // e043
val Group: Icon = "" // e044
val Trophy: Icon = "" // e045
val ThumbsUp: Icon = "" // e046
val Back: Icon = "" // e047
val CautionCircle: Icon = "" // e048
val NotAllowed: Icon = "" // e049
val RandomColor: Icon = "" // e04a
val Pencil: Icon = "" // e04b
val Cogs: Icon = "" // e04c
val Tag: Icon = "" // e04d
val Clock: Icon = "" // e04e
val Trash: Icon = "" // e04f
val User: Icon = "" // e050
val StarOutline: Icon = "" // e051
val Star: Icon = "" // e052
val MoreTriangle: Icon = "" // e053
val Eye: Icon = "" // e054
val Power: Icon = "" // e055
val Download: Icon = "" // e056
val Search: Icon = "" // e057
val Forward: Icon = "" // e058
val UltraBullet: Icon = "" // e059
val Storm: Icon = "" // e05a
val Tools: Icon = "" // e05b
val Bullseye: Icon = "" // e05c
val Agent: Icon = "" // e05d
val Mic: Icon = "" // e05e
val BarChart: Icon = "" // e05f
val InfoCircle: Icon = "" // e060
val ScreenDesktop: Icon = "" // e061
val PhoneMobile: Icon = "" // e062
val Multiboard: Icon = "" // e063
val HeartOutline: Icon = "" // e064
val FlagRacingKings: Icon = "" // e065
val Crazyhouse: Icon = "" // e066
val Tshirt: Icon = "" // e067
val Heart: Icon = "" // e068
val RadioTower: Icon = "" // e069
val BellOutline: Icon = "" // e06a
val Disc: Icon = "" // e06b
val Wings: Icon = "" // e06c
val DiscOutline: Icon = "" // e06d
val Handset: Icon = "" // e06e
val ArrowThruApple: Icon = "" // e06f
val Clipboard: Icon = "" // e070
val Cancel: Icon = "" // e071
val Move: Icon = "" // e071
val Ibeam: Icon = "" // e072
val Voice: Icon = "" // e073
val Mask: Icon = "" // e074
val Move: Icon = "" // e075
val Cancel: Icon = "" // e073
val Voice: Icon = "" // e074
val Mask: Icon = "" // e075
val OneHalf: Icon = "" // e076
val Mute: Icon = "" // e077
val AccountCircle: Icon = "" // e078
val Logo: Icon = "" // e079
val Switch: Icon = "" // e07a
val ShareIos: Icon = "" // e07b
val ShareAndroid: Icon = "" // e07c
val Reload: Icon = "" // e078
val AccountCircle: Icon = "" // e079
val Logo: Icon = "" // e07a
val Switch: Icon = "" // e07b
Loading

0 comments on commit 9b0354a

Please sign in to comment.