Added latex-DejaVu fonts to lyx-GUI.

Increment lyx-format to 561
This commit is contained in:
Kornel Benko 2018-08-10 19:38:06 +02:00
parent 136b8a63be
commit 366e37c851
7 changed files with 77 additions and 7 deletions

View File

@ -7,6 +7,9 @@ changes happened in particular if possible. A good example would be
-----------------------
2018-08-10 Kornel Benko <kornel@lyx.org>
* format incremented to 561: Added DejaVu fonts
2018-08-07 Jürgen Spitzmüller <spitz@lyx.org>
* format incremented to 560: Time-related info insets: time, modtime, fixtime;
new buffer info inset type: name-noext.

View File

@ -445,6 +445,11 @@
\TestFont[eorm10]{ecc} % required by ccfonts
\TestPackage[ot1ccr.fd]{concmath} % required by ccfonts
\TestPackage{cmbright}
\TestPackage{DejaVuSans}
\TestPackage{DejaVuSansCondensed}
\TestPackage{DejaVuSansMono}
\TestPackage{DejaVuSerif}
\TestPackage{DejaVuSerifCondensed}
\TestPackage{eco}
\TestPackage{eulervm}
\TestPackage{feyn}

View File

@ -148,6 +148,18 @@ Font cmr
OsfFont eco
EndFont
Font DejaVuSerif
GuiName "DejaVu Serif"
Family rm
Package DejaVuSerif
EndFont
Font DejaVuSerifCondensed
GuiName "DejaVu Serif Condensed"
Family rm
Package DejaVuSerifCondensed
EndFont
AltFont eco
Family rm
Package eco
@ -528,6 +540,20 @@ Font cmss
SwitchDefault 1
EndFont
Font DejaVuSans
GuiName "DejaVu Sans"
Family sf
Package DejaVuSans
ScaleOption scaled=$$val
EndFont
Font DejaVuSansCondensed
GuiName "DejaVu Sans Condensed"
Family sf
Package DejaVuSansCondensed
ScaleOption scaled=$$val
EndFont
Font helvet
GuiName "Helvetica"
Family sf
@ -633,7 +659,6 @@ Font uop
Requires urwclassico
EndFont
#
# MONOSPACED FONTS
#
@ -667,6 +692,13 @@ Font courier
Requires psnfss
EndFont
Font DejaVuSansMono
GuiName "DejaVu Sans Mono"
Family tt
Package DejaVuSansMono
ScaleOption scaled=$$val
EndFont
Font libertine-mono
GuiName "Libertine Mono"
Family tt

View File

@ -51,6 +51,33 @@ from lyx2lyx_tools import (put_cmd_in_ert, add_to_preamble)
###
###############################################################################
def revert_dejavu(document):
" Revert native DejaVu font definition to LaTeX "
if find_token(document.header, "\\use_non_tex_fonts false", 0) != -1:
dejavu_fonts = ['DejaVuSerif', 'DejaVuSerifCondensed', 'DejaVuSans',
'DejaVuSansMono', 'DejaVuSansCondensed']
font_types = ["\\font_roman", "\\font_sans,sf", "\\font_typewriter,tt"]
for ft1 in font_types:
fts = ft1.split(",")
ft = fts[0]
i = find_token(document.header, ft, 0)
if i != -1:
val = get_value(document.header, ft, i)
words = val.split()
val = words[0].replace('"', '')
if val in dejavu_fonts:
xoption = ""
document.header[i] = ft + ' "default" ' + words[1]
if len(fts) > 1:
xval = get_value(document.header, "\\font_" + fts[1] + "_scale", 0)
# cutoff " 100"
xval = xval[:-4]
if xval != "100":
xoption = "[scaled=" + format(float(xval) / 100, '.2f') + "]"
preamble = "\\usepackage" + xoption + "{%s}" % val
add_to_preamble(document, [preamble])
def removeFrontMatterStyles(document):
" Remove styles Begin/EndFromatter"
@ -1071,10 +1098,12 @@ convert = [
[557, [convert_vcsinfo]],
[558, [removeFrontMatterStyles]],
[559, []],
[560, []]
[560, []],
[561, []]
]
revert = [
[560, [revert_dejavu]],
[559, [revert_timeinfo, revert_namenoextinfo]],
[558, [revert_dateinfo]],
[557, [addFrontMatterStyles]],

View File

@ -141,18 +141,18 @@ const char * const known_old_language_packages[] = {"french", "frenchle",
char const * const known_fontsizes[] = { "10pt", "11pt", "12pt", 0 };
const char * const known_roman_fonts[] = { "ae", "beraserif", "bookman",
"ccfonts", "chancery", "charter", "cmr", "cochineal", "crimson", "fourier",
"ccfonts", "chancery", "charter", "cmr", "cochineal", "crimson", "DejaVuSerif", "DejaVuSerifCondensed", "fourier",
"garamondx", "libertine", "libertineRoman", "libertine-type1", "lmodern", "mathdesign", "mathpazo",
"mathptmx", "MinionPro", "newcent", "NotoSerif-TLF", "PTSerif-TLF", "tgbonum", "tgchorus",
"tgpagella", "tgschola", "tgtermes", "utopia", "xcharter", 0 };
const char * const known_sans_fonts[] = { "avant", "berasans", "biolinum",
"biolinum-type1", "cmbr", "cmss", "helvet", "iwona", "iwonac", "iwonal", "iwonalc",
"biolinum-type1", "cmbr", "cmss", "DejaVuSans", "DejaVuSansCondensed", "helvet", "iwona", "iwonac", "iwonal", "iwonalc",
"kurier", "kurierc", "kurierl", "kurierlc", "lmss", "NotoSans-TLF", "PTSans-TLF",
"tgadventor", "tgheros", "uop", 0 };
const char * const known_typewriter_fonts[] = { "beramono", "cmtl", "cmtt",
"courier", "lmtt", "luximono", "fourier", "libertineMono", "libertineMono-type1", "lmodern",
"courier", "DejaVuSansMono", "lmtt", "luximono", "fourier", "libertineMono", "libertineMono-type1", "lmodern",
"mathpazo", "mathptmx", "newcent", "NotoMono-TLF", "PTMono-TLF", "tgcursor", "txtt", 0 };
const char * const known_math_fonts[] = { "eulervm", "newtxmath", 0};

View File

@ -63,6 +63,7 @@ Format LaTeX feature LyX feature
556 Bib files encoding
\begin_inset CommandInset bibtex Biblatex: bibencoding=<encoding> [latex name]
encoding=<encoding> [lyx name] BibTeX: \bgroup\inputencoding{<encoding>}...\egroup
561 DejaVu fonts for latex \font_(roman|sans|typewriter) setting

View File

@ -32,8 +32,8 @@ extern char const * const lyx_version_info;
// Do not remove the comment below, so we get merge conflict in
// independent branches. Instead add your own.
#define LYX_FORMAT_LYX 560 // spitz: time info insets
#define LYX_FORMAT_TEX2LYX 560
#define LYX_FORMAT_LYX 561 // kornel: Added dejavu fonts
#define LYX_FORMAT_TEX2LYX 561
#if LYX_FORMAT_TEX2LYX != LYX_FORMAT_LYX
#ifndef _MSC_VER