Am Freitag, den 10.08.2018, 15:41 +0200 schrieb Kornel Benko:
> Would the following work? And is it OK to not have the conversion
> routine?

Yes.

> ###############################
> 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",
> "\\font_typewriter"]
>         for ft in font_types:
>             i = find_token(document.header, ft, 0)
>             if i != -1:
>                 val = get_value(document.header, ft, i)
>                 if val in dejavu_fonts:
>                     preamble = "\\usepackage{%s}" % val
>                     add_to_preamble(document, [preamble])
>                     document.header[i] =
> document.header[i].replace(val, "default")

Looks good. But don't you want to support the scaled option of the
package?

> ###############################
> 
> Also looking into lyx_2_4.py
> revert =  [
>            [558, [revert_timeinfo, revert_namenoextinfo]],
>            [558, [revert_dateinfo]],
> ...
> looks wrong (2 times 558). Do I miss something here?

Fixed. Thanks.

Jürgen

> 
>       Kornel

Attachment: signature.asc
Description: This is a digitally signed message part

Reply via email to