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

Add tgfont namespace #3343

Merged
merged 4 commits into from
Sep 20, 2024
Merged
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
2 changes: 2 additions & 0 deletions code/__DEFINES/fonts.dm
Original file line number Diff line number Diff line change
Expand Up @@ -19,3 +19,5 @@
#define SHARE "Share Tech Mono"

GLOBAL_LIST_INIT(pda_styles, sortList(list(MONO, VT, ORBITRON, SHARE)))

#define EMOJI_SET 'icons/emoji.dmi'
2 changes: 1 addition & 1 deletion code/game/objects/items/devices/PDA/cart.dm
Original file line number Diff line number Diff line change
Expand Up @@ -446,7 +446,7 @@ Code:
if(!emoji_table)
var/datum/asset/spritesheet/sheet = get_asset_datum(/datum/asset/spritesheet/chat)
var/list/collate = list("<br><table>")
for(var/emoji in sortList(icon_states(icon('icons/emoji.dmi'))))
for(var/emoji in sortList(icon_states(icon(EMOJI_SET))))
var/tag = sheet.icon_tag("emoji-[emoji]")
collate += "<tr><td>[emoji]</td><td>[tag]</td></tr>"
collate += "</table><br>"
Expand Down
14 changes: 11 additions & 3 deletions code/modules/asset_cache/asset_list_items.dm
Original file line number Diff line number Diff line change
Expand Up @@ -155,6 +155,15 @@
)
parents = list("font-awesome.css" = 'html/font-awesome/css/all.min.css')

/datum/asset/simple/namespaced/tgfont
assets = list(
"tgfont.eot" = file("tgui/packages/tgfont/static/tgfont.eot"),
"tgfont.woff2" = file("tgui/packages/tgfont/static/tgfont.woff2"),
)
parents = list(
"tgfont.css" = file("tgui/packages/tgfont/static/tgfont.css"),
)

/datum/asset/simple/fonts
assets = list(
"sga.ttf" = 'html/sga.ttf'
Expand All @@ -169,8 +178,8 @@
/datum/asset/spritesheet/chat
name = "chat"

/datum/asset/spritesheet/chat/register()
InsertAll("emoji", 'icons/emoji.dmi')
/datum/asset/spritesheet/chat/create_spritesheets()
InsertAll("emoji", EMOJI_SET)
// pre-loading all lanugage icons also helps to avoid meta
InsertAll("language", 'icons/misc/language.dmi')
// catch languages which are pulling icons from another file
Expand All @@ -180,7 +189,6 @@
if (icon != 'icons/misc/language.dmi')
var/icon_state = initial(L.icon_state)
Insert("language-[icon_state]", icon, icon_state=icon_state)
..()

/datum/asset/simple/lobby
assets = list(
Expand Down
4 changes: 2 additions & 2 deletions code/modules/emoji/emoji_parse.dm
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
. = text
if(!CONFIG_GET(flag/emojis))
return
var/static/list/emojis = icon_states(icon('icons/emoji.dmi'))
var/static/list/emojis = icon_states(icon(EMOJI_SET))
var/parsed = ""
var/pos = 1
var/search = 0
Expand Down Expand Up @@ -34,7 +34,7 @@
. = text
if(!CONFIG_GET(flag/emojis))
return
var/static/list/emojis = icon_states(icon('icons/emoji.dmi'))
var/static/list/emojis = icon_states(icon(EMOJI_SET))
var/final = "" //only tags are added to this
var/pos = 1
var/search = 0
Expand Down
1 change: 1 addition & 0 deletions code/modules/tgui_panel/tgui_panel.dm
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,7 @@
get_asset_datum(/datum/asset/simple/tgui_panel),
))
window.send_asset(get_asset_datum(/datum/asset/simple/namespaced/fontawesome))
window.send_asset(get_asset_datum(/datum/asset/simple/namespaced/tgfont))
window.send_asset(get_asset_datum(/datum/asset/spritesheet/chat))
request_telemetry()
addtimer(CALLBACK(src, PROC_REF(on_initialize_timed_out)), 5 SECONDS)
Expand Down
Loading