I am working with a company standard that all reporting is done in Times New Roman, including graphs. I've created a custom template, see below. If I use Times New Roman in the GraphUnicodeText reference then unicode characters do not get resolved when doing, labelattrs=GraphUnicodeText(size=9pt weight=bold) within an SGPLOT statement (specifically on the YAXIS statement).
Is there any way to get unicode characters in Times New Roman?
class GraphFonts /
'NodeDetailFont' = ("Times New Roman",7pt)
'NodeInputLabelFont' = ("Times New Roman",9pt)
'NodeLabelFont' = ("Times New Roman",9pt)
'NodeTitleFont' = ("Times New Roman",9pt)
'GraphDataFont' = ("Times New Roman",8pt)
'GraphUnicodeFont' = ("<MTserif-unicode>",9pt)
'GraphValueFont' = ("Times New Roman",10pt)
'GraphLabel2Font' = ("Times New Roman",11pt)
'GraphLabelFont' = ("Times New Roman",11pt)
'GraphFootnoteFont' = ("Times New Roman",11pt)
'GraphTitleFont' = ("Times New Roman",12pt,bold)
'GraphTitle1Font' = ("Times New Roman",15pt,bold)
'GraphAnnoFont' = ("Times New Roman",10pt);
The <MTserif-unicode> directive is in the SAS registry (look under ods\fonts). Still, if you are creating a custom style, and you know you'll always be using "Times New Roman", I think it's perfectly okay to replace the directive with the literal "Times New Roman Uni", since it is one of our shipped fonts. The directives are nice when you want you style to be locale-sensitive, as the registry has different values for different locales (but for <*-unicode> directives, we actually keep the same fonts).
Hope this helps!
Dan
I'll be watching for any informed answers you receive. Can you post a self contained example that demonstrates the problem?
The <MTSerif-unicde> directive resolves to "Times New Roman Uni", which contains a much fuller Unicode specification than just "Times New Roman". Is that font not working for you?
Thanks Dan,
Yes, if I keep 'GraphUnicodeFont' = ("<MTserif-unicode>",9pt) in the template, the ODS escapecharacter with UNICODE works just fine. If I do, 'GraphUnicodeFont' = ("Times New Roman",9pt) it does not. I guess I wasn't aware that MTSerif-unicde resolves to "Times New Roman Uni". Is that tribal knowledge or is that documented somewhere?
I am a bit curious because given the operating system we had to register the Times New Roman font using:
proc fontreg mode=all msglevel=verbose;
fontfile "/<filepath>/times.ttf";
run;
So, how confident are we that we something like "Times New Roman-Unicode" that you are mentioning is actually being used and not some similar looking font? That is, would we also have to register a font called "Times New Roman-Unicode"?
Thanks in advance for shedding a light on this.
The <MTserif-unicode> directive is in the SAS registry (look under ods\fonts). Still, if you are creating a custom style, and you know you'll always be using "Times New Roman", I think it's perfectly okay to replace the directive with the literal "Times New Roman Uni", since it is one of our shipped fonts. The directives are nice when you want you style to be locale-sensitive, as the registry has different values for different locales (but for <*-unicode> directives, we actually keep the same fonts).
Hope this helps!
Dan
Registration is now open for SAS Innovate 2025 , our biggest and most exciting global event of the year! Join us in Orlando, FL, May 6-9.
Sign up by Dec. 31 to get the 2024 rate of just $495.
Register now!
Learn how use the CAT functions in SAS to join values from multiple variables into a single value.
Find more tutorials on the SAS Users YouTube channel.
Ready to level-up your skills? Choose your own adventure.