Skip to content

Commit

Permalink
Define props before using
Browse files Browse the repository at this point in the history
A recent expl3 update makes using an undefined property list throw an error.
  • Loading branch information
gucci-on-fleek committed Feb 21, 2024
1 parent 34b044e commit b895aa2
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions source/unnamed-emoji.sty
Original file line number Diff line number Diff line change
Expand Up @@ -90,12 +90,18 @@
\pdfximage named { emoji #2 } { unnamed-emoji- #1 .pdf }

% Save a reference to the object
\prop_if_exist:cF { g__unemoji_ #1 _prop } {
\prop_new:c { g__unemoji_ #1 _prop }
}
\prop_gput:cnV { g__unemoji_ #1 _prop } { #2 } \pdflastximage
}

% Prints an emoji
\cs_new_protected:Nn \__unemoji_print:nn {
% See if we've already loaded this emoji
\prop_if_exist:cF { g__unemoji_ #1 _prop } {
\prop_new:c { g__unemoji_ #1 _prop }
}
\prop_get:cnNTF { g__unemoji_ #1 _prop } { #2 } \l_tmpa_tl {
% If we've already loaded it, just dereference the XObject
\pdfrefximage \l_tmpa_tl \scan_stop:
Expand Down Expand Up @@ -188,6 +194,10 @@
\str_set:Ne \l_tmpa_str { \str_mdfive_hash:n { #2 } }

% See if we've already loaded this emoji
\prop_if_exist:cF { g__unemoji_ #1 _prop } {
\prop_new:c { g__unemoji_ #1 _prop }
}

\prop_get:cVNTF { g__unemoji_ #1 _prop } \l_tmpa_str \l_tmpa_tl {
% Dereference the XObject
\hbox_to_wd:Vn
Expand Down

0 comments on commit b895aa2

Please sign in to comment.