~ubuntu-branches/ubuntu/precise/ipe/precise

« back to all changes in this revision

Viewing changes to src/ipe5toxml/ipe5toxml.c

  • Committer: Bazaar Package Importer
  • Author(s): Steve M. Robbins
  • Date: 2007-01-09 23:14:51 UTC
  • mfrom: (3.1.4 feisty)
  • Revision ID: james.westby@ubuntu.com-20070109231451-3nd095g7ishc108l
Tags: 6.0pre27-3
* debian/gsfonts-fontmap.xml: New.  Fontmap for fonts from gsfonts package.
* debian/rules: Use gsfonts-fontmap.xml instead of tetex-fontmap.xml.
* debian/control: Add texlive-latex-base dependency as alternative to
  tetex-bin (for pdflatex) and replace tetex-extra by gsfonts (for font
  files).  Patch courtesy of Norbert Preining.  Closes: #378537.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
1
/*
2
2
 
3
3
    This file is part of the extensible drawing editor Ipe.
4
 
    Copyright (C) 1993-2004  Otfried Cheong
 
4
    Copyright (C) 1993-2005  Otfried Cheong
5
5
 
6
6
    Ipe is free software; you can redistribute it and/or modify it
7
7
    under the terms of the GNU General Public License as published by
31
31
 * version 5.0) to XML format as used by Ipe 6.0.
32
32
 */
33
33
 
34
 
#define IPE5TOXML_VERSION "ipe5toxml 2003/04/10"
35
 
 
36
 
#ifdef __BORLANDC__
37
 
#pragma warn -8060
38
 
#pragma warn -8071
39
 
#endif
 
34
#define IPE5TOXML_VERSION "ipe5toxml 2005/11/14"
40
35
 
41
36
#include <stdio.h>
42
37
#include <stdlib.h>
57
52
#define IPE_ENDGROUP   8
58
53
#define IPE_SEGMENTS   9
59
54
 
60
 
/* Mediabox of the pages in the XML file.  This is for A4, the
61
 
   international SI standard for paper size.  You could change it if
62
 
   you need a different paper size, but it's not really worth it ---
63
 
   in most documents (figures for inclusion into Latex) the mediabox
64
 
   isn't used at all, and if you have really made "mipe" presentations
65
 
   in Ipe in the past, you'll probably want to touch them up anyway.
66
 
*/
67
 
const int MEDIABOX_WIDTH = 595;
68
 
const int MEDIABOX_HEIGHT = 842;
69
 
 
70
55
const double SPLINE_MULTI_THRESHOLD_SQUARED = 0.01;
71
56
 
72
57
const double IpePi = 3.1415926535897932385;
730
715
 
731
716
static void write_linestyle(IpeObject *iobj)
732
717
{
733
 
  if (iobj->linestyle != 0 && iobj->linestyle != 0xffff) {
 
718
  if (iobj->stroke.red == -1) {
 
719
    fprintf(fh, " dash=\"void\"");
 
720
  } else if (iobj->linestyle != 0 && iobj->linestyle != 0xffff) {
734
721
    fprintf(fh, " dash=\"");
735
722
    write_dashes(iobj->linestyle);
736
723
    fprintf(fh, "\"");
788
775
      fprintf(fh, "<group>\n");
789
776
    else {
790
777
      if (firstpage) {
791
 
        fprintf(fh, "<ipestyle>\n<template name=\"background\">\n<group>\n");
 
778
        fprintf(fh, "<ipestyle>\n<template name=\"Background\">\n<group>\n");
792
779
      } else {
793
780
        fprintf(fh, "<page>\n");
794
 
        fprintf(fh, "<layer name=\"alpha\"/>\n");
795
 
        fprintf(fh, "<layer name=\"background\"/>\n");
796
781
      }
797
782
    }
798
783
    grouplevel++;
806
791
        fprintf(fh, "</group>\n</template>\n</ipestyle>\n");
807
792
        firstpage = 0;
808
793
      } else {
809
 
        fprintf(fh, "<ref layer=\"background\" name=\"background\"/>\n");
810
794
        fprintf(fh, "</page>\n");
811
795
      }
812
796
    }
1171
1155
    exit(9);
1172
1156
  }
1173
1157
 
1174
 
  {
1175
 
    double cx = 0.5 * (bb.xmax + bb.xmin);
1176
 
    double cy = 0.5 * (bb.ymax + bb.ymin);
1177
 
    fprintf(fh, "<ipe creator=\"%s\" media=\"%g %g %g %g\">\n",
1178
 
            IPE5TOXML_VERSION,
1179
 
            cx - 0.5 * MEDIABOX_WIDTH,
1180
 
            cy - 0.5 * MEDIABOX_HEIGHT,
1181
 
            cx + 0.5 * MEDIABOX_WIDTH,
1182
 
            cy + 0.5 * MEDIABOX_HEIGHT);
1183
 
  }
 
1158
  fprintf(fh, "<ipe creator=\"%s\">\n", IPE5TOXML_VERSION);
1184
1159
  {
1185
1160
    char *p = preamble;
1186
1161
    while (*p && *p != '}')