summaryrefslogtreecommitdiff
path: root/print/tex-xdvik/files/patch-texk-xdvik-dvi-init.c
diff options
context:
space:
mode:
authorHiroki Sato <hrs@FreeBSD.org>2013-05-06 00:44:22 +0000
committerHiroki Sato <hrs@FreeBSD.org>2013-05-06 00:44:22 +0000
commit139838ce1dace9d35cb8d660e6e591b3fb19f34e (patch)
treef024a0631ef42d4f33ad0f86f2ce804fa502b489 /print/tex-xdvik/files/patch-texk-xdvik-dvi-init.c
parent- Upgrade to 0.22. (diff)
TeXLive mega commit. The following ports have been added:
* Meta port - print/texlive-full: meta port to install all of the TeXLive components * Libraries - devel/tex-kpathsea: kpathsea library - devel/tex-web2c: WEB2C toolchain and TeX engines - print/tex-ptexenc: character code conversion library for pTeX * Base part of the TeXLive - print/texlive-base: binary programs in TeXLive - print/texlive-texmf: macro and font data in TeXLive - print/texlive-infra: tlmgr dependency (Perl modules) * TeX Formats - print/tex-formats: TeX, LaTeX, PDFTeX, AMSTeX, ConTeXT, CSLaTeX, EplainTeX, METAFONT, MLTeX, PDFTeX, TeXsis - print/tex-aleph: Aleph/Lambda - print/tex-xetex: XeTeX - print/tex-luatex: LuaTeX - print/tex-jadetex: JadeTeX - print/tex-xmltex: XMLTeX - japanese/tex-ptex: pTeX * DVI ware - print/tex-xdvik: XDvi Mk/bsd.tex.mk is added for common part and USE_TEX knob [1]. Approved by: portmgr (old version) [1] PR: ports/171571 PR: ports/176399 [1]
Notes
Notes: svn path=/head/; revision=317452
Diffstat (limited to '')
-rw-r--r--print/tex-xdvik/files/patch-texk-xdvik-dvi-init.c92
1 files changed, 92 insertions, 0 deletions
diff --git a/print/tex-xdvik/files/patch-texk-xdvik-dvi-init.c b/print/tex-xdvik/files/patch-texk-xdvik-dvi-init.c
new file mode 100644
index 000000000000..75b97b255753
--- /dev/null
+++ b/print/tex-xdvik/files/patch-texk-xdvik-dvi-init.c
@@ -0,0 +1,92 @@
+--- dvi-init.c.orig 2013-04-05 09:14:54.000000000 +0900
++++ dvi-init.c 2013-05-06 05:13:12.000000000 +0900
+@@ -53,6 +53,9 @@
+ #include "statusline.h"
+ #include "events.h"
+ #include "font-open.h"
++#ifdef HAVE_LIBPAPER
++#include <paper.h>
++#endif
+
+ #if FREETYPE
+ # include FT_SIZES_H
+@@ -865,9 +868,14 @@
+ char temp[21];
+ const char **p;
+ char *q;
++#ifdef HAVE_LIBPAPER
++ const struct paper *pp;
++ int landscape = 0;
++#else
+ const char **paper_types = get_paper_types();
+ size_t paper_types_size = get_paper_types_size();
+-
++#endif
++
+ if (*arg == '+') {
+ ++arg;
+ ignore_papersize_specials = True;
+@@ -884,6 +892,55 @@
+ break;
+ }
+ arg = temp;
++#ifdef HAVE_LIBPAPER
++ paperinit();
++ if (strcmp(temp, "libpaper") == 0) {
++ const char *name;
++
++ name = systempapername();
++ if (name == NULL)
++ name = defaultpapername();
++
++ strncpy(temp, name, sizeof(temp));
++ temp[sizeof(temp) - 1] = '\0';
++ }
++ if (strcmp(temp, "letter") != 0 ||
++ strcmp(temp, "ledgar") != 0) {
++ if (temp[strlen(temp) - 1] == 'r') {
++ temp[strlen(temp) - 1] = '\0';
++ landscape = 1;
++ }
++ }
++ for (pp = paperfirst(); pp; pp = papernext(pp)) {
++ if (strcmp(temp, papername(pp)) == 0) {
++ double w, h;
++ char wstr[256];
++ char hstr[256];
++
++ if (landscape == 0) {
++ w = paperpswidth(pp);
++ h = paperpsheight(pp);
++ } else {
++ h = paperpswidth(pp);
++ w = paperpsheight(pp);
++ }
++ w = w / 72.0 * 10 * 2.54;
++ h = h / 72.0 * 10 * 2.54;
++ snprintf(wstr, sizeof(wstr), "%f mm", w);
++ snprintf(hstr, sizeof(hstr), "%f mm", h);
++ wstr[sizeof(wstr) - 1] = '\0';
++ hstr[sizeof(hstr) - 1] = '\0';
++ m_paper_unshrunk_w = atopix(wstr, False);
++ m_paper_unshrunk_h = atopix(hstr, False);
++ globals.grid_paper_unit = atopixunit("mm");
++
++ break;
++ }
++ }
++ paperdone();
++ if (pp == NULL)
++ return (False);
++#else
+ /* perform substitutions */
+ for (p = paper_types; p < paper_types + paper_types_size; p += 2) {
+ if (strcmp(temp, *p) == 0) {
+@@ -898,6 +955,7 @@
+ m_paper_unshrunk_h = atopix(arg1 + 1, False);
+
+ globals.grid_paper_unit = atopixunit(arg);
++#endif
+
+ return (m_paper_unshrunk_w != 0 && m_paper_unshrunk_h != 0);
+ }