MCPcopy Create free account
hub / github.com/TruthHun/BookStack / retrieveTextFontName

Function retrieveTextFontName

static/katex/katex.js:5856–5894  ·  view source on GitHub ↗
(fontFamily, fontWeight, fontShape)

Source from the content-addressed store, hash-verified

5854
5855
5856var retrieveTextFontName = function retrieveTextFontName(fontFamily, fontWeight, fontShape) {
5857 var baseFontName = "";
5858
5859 switch (fontFamily) {
5860 case "amsrm":
5861 baseFontName = "AMS";
5862 break;
5863
5864 case "textrm":
5865 baseFontName = "Main";
5866 break;
5867
5868 case "textsf":
5869 baseFontName = "SansSerif";
5870 break;
5871
5872 case "texttt":
5873 baseFontName = "Typewriter";
5874 break;
5875
5876 default:
5877 baseFontName = fontFamily;
5878 // use fonts added by a plugin
5879 }
5880
5881 var fontStylesName;
5882
5883 if (fontWeight === "textbf" && fontShape === "textit") {
5884 fontStylesName = "BoldItalic";
5885 } else if (fontWeight === "textbf") {
5886 fontStylesName = "Bold";
5887 } else if (fontWeight === "textit") {
5888 fontStylesName = "Italic";
5889 } else {
5890 fontStylesName = "Regular";
5891 }
5892
5893 return baseFontName + "-" + fontStylesName;
5894};
5895/**
5896 * Maps TeX font commands to objects containing:
5897 * - variant: string used for "mathvariant" attribute in buildMathML.js

Callers 1

buildCommon_makeOrdFunction · 0.70

Calls

no outgoing calls

Tested by

no test coverage detected