]> git.lyx.org Git - features.git/commitdiff
Merge the preview mechanism for japanese with the standard one.
authorJulien Rioux <jrioux@lyx.org>
Sun, 11 Sep 2011 18:23:15 +0000 (18:23 +0000)
committerJulien Rioux <jrioux@lyx.org>
Sun, 11 Sep 2011 18:23:15 +0000 (18:23 +0000)
  - Japanese is now handled by passing the option --latex=platex
    to the standard lyxpreview script. This is done in PreviewLoader.
  - Remove obsoleted file lyxpreview-platex2bitmap.py and the
    corresponding lines in the configure script.

git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39659 a592a061-630c-0410-9148-cb99ea01b6c8

development/scons/scons_manifest.py
lib/Makefile.am
lib/configure.py
lib/scripts/lyxpreview-platex2bitmap.py [deleted file]
src/graphics/PreviewLoader.cpp

index 89ecbd2fd957424b69fc2e1d069f45e9ac123d2b..42e6d39660bea49f6a6ab5f770f93edde50bdaea 100644 (file)
@@ -3014,7 +3014,6 @@ lib_scripts_files = Split('''
     listerrors
     lyxpak.py
     lyxpreview2bitmap.py
-    lyxpreview-platex2bitmap.py
     lyxpreview_tools.py
     lyxstangle.R
     lyxsweave.R
index a7a74ce83a05b6db14fb20b9833d6cf4eeb86d20..39b5900a46902d5ef4ee032791acd618bd638646 100644 (file)
@@ -1505,7 +1505,6 @@ dist_scripts_PYTHON = \
        scripts/listerrors \
        scripts/lyxpak.py \
        scripts/lyxpreview2bitmap.py \
-       scripts/lyxpreview-platex2bitmap.py \
        scripts/lyxpreview_tools.py \
        scripts/prefs2prefs.py \
        scripts/prefs2prefs_lfuns.py \
index e2cdb97ec0198a3b57edebd92184be2159156e2f..522da331c1e098831faad4febb945106bc9534ef 100644 (file)
@@ -596,7 +596,6 @@ def checkFormatEntries(dtl_tools):
 \Format jlyx       cjklyx "CJK LyX 1.4.x (euc-jp)" "" ""       ""      "document"
 \Format klyx       cjklyx "CJK LyX 1.4.x (euc-kr)" "" ""       ""      "document"
 \Format lyxpreview lyxpreview "LyX Preview"       "" ""        ""      ""
-\Format lyxpreview-platex lyxpreview-platex "LyX Preview (pLaTeX)"       "" "" ""      ""
 \Format pdftex     pdftex_t PDFTEX                "" ""        ""      ""
 \Format program    ""      Program                "" ""        ""      ""
 \Format pstex      pstex_t PSTEX                  "" ""        ""      ""
@@ -895,7 +894,7 @@ def checkConverterEntries(java='', perl=''):
     # checkProg('Image converter', ['convert $$i $$o'])
     #
     # Entries that do not need checkProg
-    addToRC(r'''\converter lyxpreview-platex ppm        "python -tt $$s/scripts/lyxpreview-platex2bitmap.py"   ""
+    addToRC(r'''
 \converter csv        lyx        "python -tt $$s/scripts/csv2lyx.py $$i $$o"   ""
 \converter date       dateout    "python -tt $$s/scripts/date.py %d-%m-%Y > $$o"       ""
 \converter docbook    docbook-xml "cp $$i $$o" "xml"
diff --git a/lib/scripts/lyxpreview-platex2bitmap.py b/lib/scripts/lyxpreview-platex2bitmap.py
deleted file mode 100644 (file)
index 6f6b491..0000000
+++ /dev/null
@@ -1,35 +0,0 @@
-#! /usr/bin/env python
-
-# This script takes a pLaTeX file and generates a collection of
-# png or ppm image files, one per previewed snippet.
-# Example usage:
-# lyxpreview-platex2bitmap.py ppm 0lyxpreview.tex 128 000000 faf0e6
-
-# This script takes five arguments:
-# FORMAT:   The desired output format. 'ppm'.
-# TEXFILE:  the name of the .tex file to be converted.
-# DPI:      a scale factor, used to ascertain the resolution of the
-#           generated image which is then passed to gs.
-# FG_COLOR: the foreground color as a hexadecimal string, eg '000000'.
-# BG_COLOR: the background color as a hexadecimal string, eg 'faf0e6'.
-
-import sys
-from legacy_lyxpreview2ppm import legacy_conversion
-
-def usage(prog_name):
-    return "Usage: %s <format> <latex file> <dpi> <fg color> <bg color>\n"\
-           "\twhere the colors are hexadecimal strings, eg 'faf0e6'"\
-           % prog_name
-
-def main(argv):
-    # Parse and manipulate the command line arguments.
-    if len(argv) != 6 and len(argv) != 7:
-        error(usage(argv[0]))
-    # The arguments of legacy_conversion are the same as 
-    # those used in LyX 1.3.x, except for the 6th argument.
-    # The 7th argument is just ignored, since we use platex always
-    vec = [ argv[0], argv[2], argv[3], argv[1], argv[4], argv[5], "platex"]
-    return legacy_conversion(vec)
-
-if __name__ == "__main__":
-    main(sys.argv)
index 38eb1d8b821c69e69fe5c28d8752fbe22488c3cb..feadc45c9e80bb417d46bf0bbfcd2f0ac6b27176 100644 (file)
@@ -388,9 +388,7 @@ namespace graphics {
 PreviewLoader::Impl::Impl(PreviewLoader & p, Buffer const & b)
        : parent_(p), buffer_(b)
 {
-       if (b.params().encoding().package() == Encoding::japanese)
-               pconverter_ = setConverter("lyxpreview-platex");
-       else
+       if (!pconverter_)
                pconverter_ = setConverter("lyxpreview");
 }
 
@@ -602,6 +600,8 @@ void PreviewLoader::Impl::startLoading(bool wait)
        // FIXME what about LuaTeX?
        if (buffer_.params().useNonTeXFonts)
                cs << " --latex=xelatex";
+       if (buffer_.params().encoding().package() == Encoding::japanese)
+               cs << " --latex=platex";
        if (buffer_.params().bufferFormat() == "lilypond-book")
                cs << " --lilypond";