Lines Matching refs:font
213 } else if (group.type === "font") {
512 * Scripts only need to appear here if they do not have font metrics.
631 // sqrtMain path geometry is from glyph U221A in the font KaTeX Main
647 // size1 is from glyph U221A in the font KaTeX_Size1-Regular
662 // size2 is from glyph U221A in the font KaTeX_Size2-Regular
676 // size3 is from glyph U221A in the font KaTeX_Size3-Regular
691 // size4 is from glyph U221A in the font KaTeX_Size4-Regular
703 // sqrtTall is from glyph U23B7 in the font KaTeX_Size4-Regular
748 // The doubleleftarrow geometry is from glyph U+21D0 in the font KaTeX Main
758 // doublerightarrow is from glyph U+21D2 in font KaTeX Main
767 // leftarrow is from glyph U+2190 in font KaTeX Main
775 // overbrace is from glyphs U+23A9/23A8/23A7 in font KaTeX_Size4-Regular
790 // Harpoons are from glyph U+21BD in font KaTeX Main
808 // hook is from glyph U+21A9 in font KaTeX Main
817 // tofrom is from glyph U+21C4 in font KaTeX AMS Regular
895 // twoheadleftarrow is from glyph U+219E in font KaTeX AMS Regular
930 // vec is from glyph U+20D7 in font KaTeX Main
959 // baraboveleftarrow is mostly from from glyph U+2190 in font KaTeX Main
1363 // characters with a serif font in situations where the browser would
3725 * TeX, TeX font metrics, and the TTF files. These data are then exposed via the
3733 // The font metrics are stored in fonts cmsy10, cmsy7, and cmsy5 respsectively.
3796 // These font metrics are extracted from TeX by using tftopl on cmex10.tfm;
3797 // they correspond to the font parameters of the extension fonts (family 3).
3814 // Since we use the same font at all sizes, this thickness doesn't scale.
3832 }; // This map contains a mapping from font name and character code to character
3918 * This function adds new font metrics to default metricMap
3926 * metricMap table. It takes a character as a string, and a font.
3932 function getCharacterMetrics(character, font, mode) { argument
3933 if (!metricMap[font]) {
3934 throw new Error(`Font metrics not found for font: ${font}.`);
3938 let metrics = metricMap[font][ch];
3942 metrics = metricMap[font][ch];
3946 // We don't typically have font metrics for Asian scripts.
3955 metrics = metricMap[font][77]; // 77 is the charcode for 'M'
3971 * Get the font metrics for a given size.
4005 * - font (required): the font to be used for this symbol. Either "main" (the
4006 normal font), or "ams" (the ams fonts).
4012 * character in the main font).
4042 function defineSymbol(mode, font, group, replace, name, acceptUnicodeChar) { argument
4044 font, property
4829 } // TODO: Add bold script when it is supported by a KaTeX font.
4858 // but they are not actually in the font, nor are they supported by the
4859 // Unicode accent mechanism, so they fall back to Times font and look ugly.
4885 * the font information necessary to render it properly.
4889 * That document sorts characters into groups by font type, say bold or italic.
4894 * * The font name, so that KaTeX can get font metrics.
4906 ["", "", ""], // a-z script. No font
4907 ["", "", ""], // A-Z bold script. No font
4908 ["", "", ""], // a-z bold script. No font
4913 ["", "", ""], // A-Z bold Fraktur No font metrics
4914 ["", "", ""], // a-z bold Fraktur. No font.
4921 ["", "", ""], // A-Z bold italic sans. No font
4922 ["", "", ""], // a-z bold italic sans. No font
4926 ["", "", ""], // 0-9 double-struck. No KaTeX font.
4990 * and font.
4996 // A font family applies to a group of fonts (i.e. SansSerif), while a font
4997 // represents a specific font (i.e. SansSerif Bold).
5009 this.font = void 0;
5022 this.font = data.font || "";
5044 font: this.font, property
5175 * Creates a new options object with the given math font or old text font.
5180 withFont(font) { argument
5182 font field
5193 font: "" property
5197 * Creates a new options object with the given font weight
5204 font: "" property
5208 * Creates a new options object with the given font weight
5215 font: "" property
5245 * Return the font metrics for this size.
5279 // *assuming* a font size of ptPerEm (normal size, normal style).
5346 // Other relative units always refer to the *textstyle* font
5356 // *text* font, e.g. cmr10. KaTeX instead uses values from the
5357 // comparably-sized *Computer Modern symbol* font. At 10pt, these
5381 // The following have to be loaded from Main-Italic font, using class mathit
5423 if (mode === "text" || options && options.font === "mathit") {
5461 // Decide what font to render the symbol in by its entry in the symbols
5468 if (options.font === "boldsymbol" && lookupSymbol(value, "Main-Bold", mode).metrics) {
5470 } else if (value === "\\" || symbols[mode][value].font === "main") {
5477 * Determines which of the two font names (Main-Italic and Math-Italic) and
5478 * corresponding style tags (maindefault or mathit) to use for default math font,
5499 * Determines which of the font names (Main-Italic, Math-Italic, and Caligraphic)
5500 * and corresponding style tags (mathit, mathdefault, or mathcal) to use for font
5502 * font "mathnormal".
5525 * Determines which of the two font names (Main-Bold and Math-BoldItalic) and
5526 * corresponding style tags (mathbf or boldsymbol) to use for font "boldsymbol",
5527 * depending on the symbol. Use this function instead of fontMap for font
5548 * Makes either a mathord or textord in the correct font and color.
5555 const classes = ["mord"]; // Math mode or Old font (i.e. \rm)
5557 const isFont = mode === "math" || mode === "text" && options.font;
5558 const fontOrFamily = isFont ? options.font : options.fontFamily;
5598 } // Makes a symbol in the default font for mathords and textords.
5605 const font = symbols[mode][text] && symbols[mode][text].font;
5607 if (font === "ams") {
5610 } else if (font === "main" || !font) {
5615 …const fontName = retrieveTextFontName(font, options.fontWeight, options.fontShape); // We add font…
5719 }; // SVG one is simpler -- doesn't require height, depth, max-font setting.
5850 // be positioned precisely without worrying about font ascent and
5947 }; // Takes font options, and returns the appropriate fontLookup name
5990 * Maps TeX font commands to objects containing:
5994 // A map between tex font commands an MathML mathvariant attribute values
6015 // Default math font, "mathnormal" and "boldsymbol" are missing because they
6017 // math font, Main-Italic, Math-Italic, Caligraphic for "mathnormal", and
6050 // values from the font glyph
6939 …fontFamily && options.fontFamily.substr(4, 2) === "tt" || options.font && options.font.substr(4, 2…
6962 // Handle \text... font specifiers as best we can.
6985 const font = options.font;
6987 if (!font || font === "mathnormal") {
6993 if (font === "mathit") {
6995 } else if (font === "boldsymbol") {
6997 } else if (font === "mathbf") {
6999 } else if (font === "mathbb") {
7001 } else if (font === "mathfrak") {
7003 } else if (font === "mathscr" || font === "mathcal") {
7006 } else if (font === "mathsf") {
7008 } else if (font === "mathtt") {
7022 const fontName = buildCommon.fontMap[font].fontName;
7025 return buildCommon.fontMap[font].variant;
7290 // from the KaTeX Main font. The scaling factor is 1000.
7291 // That is, inside the font, that arrowhead is 522 units tall, which
7577 // kern amount for the nucleus followed by the \skewchar of its font."
7606 // Before version 0.9, \vec used the combining font glyph U+20D7.
8129 * normal font, but in either text, script, or scriptscript style.
8146 * Get the metrics for a given symbol and font, after transformation (i.e.
8149 const getMetrics = function getMetrics(symbol, font, mode) { argument
8151 const metrics = getCharacterMetrics(replace || symbol, font, mode);
8154 throw new Error(`Unsupported symbol ${symbol} and font size ${font}.`);
8185 * font, but is restyled to either be in textstyle, scriptstyle, or
8201 * Builds a symbol in the given font size (note size is an integer)
8225 * Make an inner span with the given offset and in the given font. This is used
8230 const makeInner = function makeInner(symbol, font, mode) { argument
8231 let sizeClass; // Apply the correct CSS class to choose the right font.
8233 if (font === "Size1-Regular") {
8236 /* if (font === "Size4-Regular") */
8241 …r", sizeClass], [buildCommon.makeSpan([], [buildCommon.makeSymbol(symbol, font, mode)])]); // Sinc…
8268 middle = null; // Also keep track of what font the delimiters are in
8270 let font = "Size1-Regular"; // We set the parts and font based on the symbol. Note that we use
8294 font = "Size4-Regular";
8299 font = "Size4-Regular";
8303 font = "Size4-Regular";
8307 font = "Size4-Regular";
8311 font = "Size4-Regular";
8315 font = "Size4-Regular";
8320 font = "Size4-Regular";
8325 font = "Size4-Regular";
8331 font = "Size4-Regular";
8337 font = "Size4-Regular";
8342 font = "Size4-Regular";
8347 font = "Size4-Regular";
8352 font = "Size4-Regular";
8357 font = "Size4-Regular";
8361 const topMetrics = getMetrics(top, font, mode);
8363 const repeatMetrics = getMetrics(repeat, font, mode);
8365 const bottomMetrics = getMetrics(bottom, font, mode);
8371 const middleMetrics = getMetrics(middle, font, mode);
8407 inners.push(makeInner(bottom, font, mode));
8414 inners.push(makeInner(repeat, font, mode));
8421 inners.push(makeInner(repeat, font, mode));
8429 inners.push(makeInner(repeat, font, mode));
8432 inners.push(makeInner(middle, font, mode));
8436 inners.push(makeInner(repeat, font, mode));
8446 inners.push(makeInner(repeat, font, mode));
8449 inners.push(makeInner(top, font, mode)); // Finally, build the vlist
8506 // Get an SVG that is derived from glyph U+221A in font KaTeX-Main.
8520 advanceWidth = 0.833 / sizeMultiplier; // from the font.
8528 advanceWidth = 1.0 / sizeMultiplier; // 1.0 from the font.
8546 // This actually should depend on the chosen font -- e.g. \boldmath
8592 * defined inside the font metrics. Since there are only three sequences that
8661 * Get the font used in a delimiter based on what kind of delimiter it is.
8662 * TODO(#963) Use more specific font family return type once that is introduced.
8696 …etrics.height + metrics.depth; // Small delimiters are scaled down versions of the same font, so we
8738 …imType = traverseSequence(delim, height, sequence, options); // Get the delimiter from font glyphs.
10513 const font = group.font; constant
10514 const newOptions = options.withFont(font);
10519 const font = group.font; constant
10520 const newOptions = options.withFont(font);
10531 type: "font",
10551 type: "font",
10553 font: func.slice(1),
10578 type: "font",
10580 font: "boldsymbol", property
10586 }); // Old font changing functions
10589 type: "font",
10603 type: "font",
10605 font: style,
11324 font: "\\texttt", property
11900 // No font glyphs yet, so use a glyph w/o the oval.
11901 // TODO: When font glyphs are available, delete this code.
11911 // TODO: When font glyphs are available, delete this code.
12292 // amsopn.dtx: \mathop{#1\kern\z@\operator@font#3}\newmcodes@
13038 } // scriptspace is a font-size-independent size, so scale it
13390 const font = group.font; // Checks if the argument is a font family or a font style. constant
13392 if (!font) {
13394 } else if (textFontFamilies[font]) {
13395 return options.withTextFontFamily(textFontFamilies[font]);
13396 } else if (textFontWeights[font]) {
13397 return options.withTextFontWeight(textFontWeights[font]);
13399 return options.withTextFontShape(textFontShapes[font]);
13424 font: funcName
13895 // These all refer to characters from the font, so we turn them into special
14370 // {\operator@font mod}\penalty900
14374 // \renewcommand{\pmod}[1]{\pod{{\operator@font mod}\mkern6mu#1}}
14376 // \else\mkern12mu\fi{\operator@font mod}\,\,#1}
14526 // will require new font glyphs.
16989 * extends internal font metrics object with a new object
16990 * each key in the new object represents a font name