Support the mathbbm font.

Should just be able to read formulae, not add it from the GUI, as it's mostly redundant with mathds and mathbb.
This commit is contained in:
Thibaut Cuvelier 2020-07-27 03:14:38 +02:00
parent 8dd2e7e681
commit e709a6626e
10 changed files with 6479 additions and 13 deletions

6448
lib/fonts/bbm.sfd Normal file

File diff suppressed because it is too large Load Diff

BIN
lib/fonts/bbm.ttf Normal file

Binary file not shown.

View File

@ -119,6 +119,7 @@ mathnormal font mathmode inherit medium up math
frak font mathmode frak font mathmode
mathbb font mathmode mathbb font mathmode
mathds font mathmode mathds font mathmode
mathbbm font mathmode
mathbf font mathmode mathbf font mathmode
mathcal font mathmode mathcal font mathmode
mathfrak font mathmode mathfrak font mathmode

View File

@ -47,6 +47,8 @@ enum FontFamily {
/// ///
DS_FAMILY, DS_FAMILY,
/// ///
BBM_FAMILY,
///
EUFRAK_FAMILY, EUFRAK_FAMILY,
/// ///
RSFS_FAMILY, RSFS_FAMILY,

View File

@ -494,6 +494,7 @@ string getFamilyCSS(FontFamily const & f)
case MSA_FAMILY: case MSA_FAMILY:
case MSB_FAMILY: case MSB_FAMILY:
case DS_FAMILY: case DS_FAMILY:
case BBM_FAMILY:
case EUFRAK_FAMILY: case EUFRAK_FAMILY:
case RSFS_FAMILY: case RSFS_FAMILY:
case STMARY_FAMILY: case STMARY_FAMILY:

View File

@ -1159,7 +1159,8 @@ char const * simplefeatures[] = {
"pict2e", "pict2e",
"drs", "drs",
"environ", "environ",
"dsfont" "dsfont",
"bbm"
}; };
char const * bibliofeatures[] = { char const * bibliofeatures[] = {

View File

@ -36,8 +36,8 @@ using namespace std;
using namespace lyx::support; using namespace lyx::support;
QString const math_fonts[] = {"cmex10", "cmmi10", "cmr10", "cmsy10", QString const math_fonts[] = {"cmex10", "cmmi10", "cmr10", "cmsy10",
"dsrom10", "esint10", "eufm10", "msam10", "msbm10", "rsfs10", "dsrom10", "bbm10", "esint10", "eufm10", "msam10", "msbm10",
"stmary10", "wasy10"}; "rsfs10", "stmary10", "wasy10"};
int const num_math_fonts = sizeof(math_fonts) / sizeof(*math_fonts); int const num_math_fonts = sizeof(math_fonts) / sizeof(*math_fonts);
namespace lyx { namespace lyx {

View File

@ -136,6 +136,8 @@ void InsetMathFont::validate(LaTeXFeatures & features) const
features.require("mhchem"); features.require("mhchem");
if (fontname == "mathds") if (fontname == "mathds")
features.require("dsfont"); features.require("dsfont");
if (fontname == "mathbbm")
features.require("bbm");
} else if (features.runparams().math_flavor == OutputParams::MathAsHTML) { } else if (features.runparams().math_flavor == OutputParams::MathAsHTML) {
features.addCSSSnippet( features.addCSSSnippet(
"span.normal{font: normal normal normal inherit serif;}\n" "span.normal{font: normal normal normal inherit serif;}\n"

View File

@ -785,6 +785,8 @@ fontinfo fontinfos[] = {
inh_shape, Color_math}, inh_shape, Color_math},
{"mathds", DS_FAMILY, inh_series, {"mathds", DS_FAMILY, inh_series,
inh_shape, Color_math}, inh_shape, Color_math},
{"mathbbm", BBM_FAMILY, inh_series,
inh_shape, Color_math},
{"mathtt", TYPEWRITER_FAMILY, inh_series, {"mathtt", TYPEWRITER_FAMILY, inh_series,
inh_shape, Color_math}, inh_shape, Color_math},
{"mathit", inh_family, inh_series, {"mathit", inh_family, inh_series,

View File

@ -39,6 +39,7 @@
#include <stack> #include <stack>
#include <iostream> #include <iostream>
#include <algorithm> #include <algorithm>
#include <sstream>
using namespace std; using namespace std;
using namespace lyx::support; using namespace lyx::support;
@ -862,18 +863,26 @@ void outputDocBookInfo(
generateDocBookParagraphWithoutSectioning(text, buf, xs, runparams, paragraphs, bpitInfo, epitInfo); generateDocBookParagraphWithoutSectioning(text, buf, xs, runparams, paragraphs, bpitInfo, epitInfo);
if (hasAbstract) { if (hasAbstract) {
// Sometimes, there are many paragraphs that should go into the abstract, but none generates actual content.
// Thus, first generate to a temporary stream, then only create the <abstract> tag if these paragraphs
// generate some content.
odocstringstream os2;
XMLStream xs2(os2);
generateDocBookParagraphWithoutSectioning(text, buf, xs2, runparams, paragraphs, bpitAbstract, epitAbstract);
// Actually output the abstract if there is something to do.
if (!os2.str().empty()) {
string tag = paragraphs[bpitAbstract].layout().docbookforceabstracttag(); string tag = paragraphs[bpitAbstract].layout().docbookforceabstracttag();
if (tag == "NONE") if (tag == "NONE")
tag = "abstract"; tag = "abstract";
xs << xml::StartTag(tag); xs << xml::StartTag(tag);
xs << xml::CR(); xs << xml::CR();
xs.startDivision(false); xs << XMLStream::ESCAPE_NONE << os2.str();
generateDocBookParagraphWithoutSectioning(text, buf, xs, runparams, paragraphs, bpitAbstract, epitAbstract);
xs.endDivision();
xs << xml::EndTag(tag); xs << xml::EndTag(tag);
xs << xml::CR(); xs << xml::CR();
} }
}
// End the <info> tag if it was started. // End the <info> tag if it was started.
if (needInfo) { if (needInfo) {