Style[\[WhiteKnight], FontFamily -> "Segoe UI Symbol"]
The output I'm getting looks like it is in the Mathematica.ttf font, not the designated Segoe UI Symbol font. How can I get the character displayed in the font I have chosen?
Yes, Mathematica forces to display some usual characters into Mathematica font only. This is the case of your \[WhiteKnight]
:
Style[\[WhiteKnight], FontFamily -> "Apple Symbols", FontSize -> 40]
I clearly have a different \[WhiteKnight]
symbol available in my "Apple Symbols" system font but it is not displayed here above.
Actually I found some nice solutions in these posts: wrong-font-selection-for-some-characters-in-mathematica-10-for-linux and how-to-write-plain-greek-in-a-text-cell
As I have Mathematica version >= 10.0, i followed @DBM / @AlexeyBobrick well explained instructions and I am now able to get the "correct" display:
To do the same you'll have to know the character code of your symbol, which is given by:
ToCharacterCode @ ToString @ \[WhiteKnight]
{9816}
In case, you have version >=10.0 and don't want to fix the problem manually, I wrote an automated version:
1. Check first if the system file "FontMap.tr" exists:
fontmapfile = FileNames["FontMap.tr", $InstallationDirectory, Infinity] // First
/Applications/Mathematica.app/Contents/SystemFiles/FrontEnd/\ TextResources/FontMap.tr
If the command fails and does not return a file path as above, STOP here (there might be some different approach for your system).
2. If the file exists, you can modify it automatically this way (it should be safe, as you can see i backup the original file and don't modify it)
backupfile = fontmapfile <> ".BKUP";
backupfile // If[Not@FileExistsQ[#], CopyFile[fontmapfile, #]] &;
ToExpression@Import[backupfile] /. {9816 -> Sequence[]} // Compress //
Export[fontmapfile, "CompressedData[\"" <> ToString@# <> "\"]",
"String"] &;
(If you want to include other symbols, you'll just have to add their code to the list {9816 -> Nothing}
)
3. That's it. Quit and Restart mathematica and you should now be able to display your symbol(s).
Segoe UI Symbol
in Word ) $\endgroup$MemberQ[$FontFamilies, "Segoe UI Symbol"]
->True
$\endgroup$