Skip to content

Commit

Permalink
Changelog icon size fix (tgfont updates port) (#5708)
Browse files Browse the repository at this point in the history
# About the pull request

Ports tgstation/tgstation#71808 and
tgstation/tgstation#69786 from TG.

The first PR fixes an issue where some changelog icons (specifically
those for `soundadd`, `sounddel`, `imageadd`, and `imagedel`) appeared a
lot smaller than others. (See images below)

The second PR adds a VSCode task to rebuild tgfont and copy the result
to `tgui\packages\tgfont\static` automatically, rather than having to
run `yarn tgfont:build` and copy them there yourself.
This task is already mentioned in
[tgui\packages\tgfont\README_ICON_TUTORIAL.txt](https://github.com/cmss13-devs/cmss13/blob/41a39b96009f3d97206fd63416a2fb5a47c89525/tgui/packages/tgfont/README_ICON_TUTORIAL.txt#L7),
so I'm guessing it was just missed when the rest was ported over.

# Explain why it's good for the game

Fixes a bug, and makes it easier to add new font icons in the future.

# Testing Photographs and Procedure
<details>
<summary>Screenshots & Videos</summary>

**Before:**

![before](https://github.com/cmss13-devs/cmss13/assets/57483089/cdb85eeb-03a9-4768-863d-354f3599c3a1)

**After:**

![after](https://github.com/cmss13-devs/cmss13/assets/57483089/9c360b58-818e-46cd-b2dd-ff764f53eb7b)

</details>


# Changelog
:cl:
fix: Fixed some changelog icons being smaller than others.
/:cl:
  • Loading branch information
SabreML authored Feb 14, 2024
1 parent cfef302 commit 51dbf6f
Show file tree
Hide file tree
Showing 11 changed files with 49 additions and 30 deletions.
13 changes: 13 additions & 0 deletions .vscode/tasks.json
Original file line number Diff line number Diff line change
Expand Up @@ -89,6 +89,19 @@
],
"group": "build",
"label": "tgui: sonar"
},
{
"type": "shell",
"command": "bin/tgfont",
"windows": {
"command": ".\\bin\\tgfont.cmd"
},
"problemMatcher": [
"$tsc",
"$eslint-stylish"
],
"group": "build",
"label": "tgui: rebuild tgfont"
}
]
}
2 changes: 2 additions & 0 deletions bin/tgfont.cmd
Original file line number Diff line number Diff line change
@@ -0,0 +1,2 @@
@echo off
call "%~dp0\..\tools\build\build.bat" --wait-on-error tg-font %*
4 changes: 4 additions & 0 deletions tgui/packages/tgfont/config.cjs
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,12 @@
module.exports = {
name: 'tgfont',
inputDir: './icons',
normalize: true,
outputDir: './dist',
fontTypes: ['woff2', 'eot'],
assetTypes: ['css'],
prefix: 'tg',
formatOptions: {
preserveAspectRatio: true,
},
};
1 change: 1 addition & 0 deletions tgui/packages/tgfont/icons/image-minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tgui/packages/tgfont/icons/image-plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tgui/packages/tgfont/icons/sound-minus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
1 change: 1 addition & 0 deletions tgui/packages/tgfont/icons/sound-plus.svg
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
36 changes: 6 additions & 30 deletions tgui/packages/tgfont/static/tgfont.css
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@font-face {
font-family: "tgfont";
src: url("./tgfont.woff2?b809fa4bdd4aff7084540f130e4e524b") format("woff2"),
url("./tgfont.eot?b809fa4bdd4aff7084540f130e4e524b#iefix") format("embedded-opentype");
src: url("./tgfont.woff2?0843e2c3dacddd319720859dcaeda508") format("woff2"),
url("./tgfont.eot?0843e2c3dacddd319720859dcaeda508#iefix") format("embedded-opentype");
}

i[class^="tg-"]:before, i[class*=" tg-"]:before {
Expand All @@ -15,39 +15,15 @@ i[class^="tg-"]:before, i[class*=" tg-"]:before {
-moz-osx-font-smoothing: grayscale;
}

.tg-air-tank-slash:before {
content: "\f101";
}
.tg-air-tank:before {
content: "\f102";
}
.tg-bad-touch:before {
content: "\f103";
}
.tg-image-minus:before {
content: "\f104";
content: "\f101";
}
.tg-image-plus:before {
content: "\f105";
}
.tg-nanotrasen-logo:before {
content: "\f106";
}
.tg-non-binary:before {
content: "\f107";
}
.tg-prosthetic-full:before {
content: "\f108";
}
.tg-prosthetic-leg:before {
content: "\f109";
content: "\f102";
}
.tg-sound-minus:before {
content: "\f10a";
content: "\f103";
}
.tg-sound-plus:before {
content: "\f10b";
}
.tg-syndicate-logo:before {
content: "\f10c";
content: "\f104";
}
Binary file modified tgui/packages/tgfont/static/tgfont.eot
Binary file not shown.
Binary file modified tgui/packages/tgfont/static/tgfont.woff2
Binary file not shown.
20 changes: 20 additions & 0 deletions tools/build/build.js
Original file line number Diff line number Diff line change
Expand Up @@ -170,6 +170,26 @@ export const YarnTarget = new Juke.Target({
executes: ({ get }) => yarn("install", get(CiParameter) && "--immutable"),
});

export const TgFontTarget = new Juke.Target({
dependsOn: [YarnTarget],
inputs: [
'tgui/.yarn/install-target',
'tgui/packages/tgfont/**/*.+(js|cjs|svg)',
'tgui/packages/tgfont/package.json',
],
outputs: [
'tgui/packages/tgfont/dist/tgfont.css',
'tgui/packages/tgfont/dist/tgfont.eot',
'tgui/packages/tgfont/dist/tgfont.woff2',
],
executes: async () => {
await yarn('tgfont:build');
fs.copyFileSync('tgui/packages/tgfont/dist/tgfont.css', 'tgui/packages/tgfont/static/tgfont.css');
fs.copyFileSync('tgui/packages/tgfont/dist/tgfont.eot', 'tgui/packages/tgfont/static/tgfont.eot');
fs.copyFileSync('tgui/packages/tgfont/dist/tgfont.woff2', 'tgui/packages/tgfont/static/tgfont.woff2');
}
});

export const TguiTarget = new Juke.Target({
dependsOn: [YarnTarget],
inputs: [
Expand Down

0 comments on commit 51dbf6f

Please sign in to comment.