w32tex
About: TeX Live provides a comprehensive TeX system including all the major TeX-related programs, macro packages, and fonts that are free software. Windows sources.
  Fossies Dox: w32tex-src.tar.xz  ("unofficial" and yet experimental doxygen-generated source code documentation)  

chars.c
Go to the documentation of this file.
1 /* chars.c - Handle special TeX characters and logos
2 
3 Copyright (C) 2002 The Free Software Foundation
4 
5 This program is free software; you can redistribute it and/or
6 modify it under the terms of the GNU General Public License
7 as published by the Free Software Foundation; either version 2
8 of the License, or (at your option) any later version.
9 
10 This program is distributed in the hope that it will be useful,
11 but WITHOUT ANY WARRANTY; without even the implied warranty of
12 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 GNU General Public License for more details.
14 
15 You should have received a copy of the GNU General Public License
16 along with this program; if not, write to the Free Software
17 Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
18 
19 This file is available from http://sourceforge.net/projects/latex2rtf/
20 
21 */
22 
23 #include <stdlib.h>
24 #include <string.h>
25 #include <ctype.h>
26 #include "main.h"
27 #include "commands.h"
28 #include "l2r_fonts.h"
29 #include "cfg.h"
30 #include "ignore.h"
31 #include "encode.h"
32 #include "parser.h"
33 #include "chars.h"
34 #include "funct1.h"
35 #include "convert.h"
36 
37 void TeXlogo();
38 void LaTeXlogo();
39 
40 void
42 /*****************************************************************************
43  purpose : converts characters with diaeresis from LaTeX to RTF
44  ******************************************************************************/
45 {
46  int num;
47  char *cParam = getBraceParam();
48  if (cParam == NULL)
49  return;
50 
51  switch (cParam[0]) {
52  case 'o':
53  fprintRTF("\\'f6");
54  break;
55  case 'O':
56  fprintRTF("\\'d6");
57  break;
58  case 'a':
59  fprintRTF("\\'e4");
60  break;
61  case 'A':
62  fprintRTF("\\'c4");
63  break;
64  case 'u':
65  fprintRTF("\\'fc");
66  break;
67  case 'U':
68  fprintRTF("\\'dc");
69  break;
70  case 'E':
71  fprintRTF("\\'cb");
72  break;
73  case 'I':
74  fprintRTF("\\'cf");
75  break;
76  case 'e':
77  fprintRTF("\\'eb");
78  break;
79  case 'y':
80  fprintRTF("\\'ff");
81  break;
82 
83  default:
84  if (strcmp(cParam,"\\i")==0) {
85  fprintRTF("\\'ef");
86  break;
87  }
88 
89  num = RtfFontNumber("MT Extra");
91  fprintRTF("{\\field{\\*\\fldinst EQ ");
92  fprintRTF("\\\\O(");
93  ConvertString(cParam);
94  fprintRTF("%c\\\\S({\\f%d\\'26\\'26}))", g_field_separator, num);
96  fprintRTF("}{\\fldrslt }}");
97  break;
98 
99  }
100  free(cParam);
101 }
102 
103 void
105 /******************************************************************************
106  purpose: converts special symbols from LaTeX to RTF
107  ******************************************************************************/
108 {
109  int num;
110  char *cParam = getBraceParam();
111  if (cParam == NULL)
112  return;
113 
114  switch (cParam[0]) {
115  case 'A':
116  fprintRTF("\\'c0");
117  break;
118  case 'E':
119  fprintRTF("\\'c8");
120  break;
121  case 'I':
122  fprintRTF("\\'cc");
123  break;
124  case 'O':
125  fprintRTF("\\'d2");
126  break;
127  case 'U':
128  fprintRTF("\\'d9");
129  break;
130  case 'a':
131  fprintRTF("\\'e0");
132  break;
133  case 'e':
134  fprintRTF("\\'e8");
135  break;
136  case 'i':
137  fprintRTF("\\'ec");
138  break;
139  case 'o':
140  fprintRTF("\\'f2");
141  break;
142  case 'u':
143  fprintRTF("\\'f9");
144  break;
145  default:
146  if (strcmp(cParam,"\\i")==0) {
147  fprintRTF("\\'ec");
148  break;
149  }
150 
151  num = RtfFontNumber("MT Extra");
152  if (!g_processing_fields)
153  fprintRTF("{\\field{\\*\\fldinst EQ ");
154  fprintRTF("\\\\O(");
155  ConvertString(cParam);
156  fprintRTF("%c\\\\S({\\f%d\\'23}))", g_field_separator, num);
157  if (!g_processing_fields)
158  fprintRTF("}{\\fldrslt }}");
159  break;
160  }
161  free(cParam);
162 }
163 
164 void
166 /******************************************************************************
167  purpose: converts special symbols from LaTeX to RTF
168  ******************************************************************************/
169 {
170  char *cParam = getBraceParam();
171  if (cParam == NULL)
172  return;
173 
174  switch (cParam[0]) {
175  case 'A':
176  fprintRTF("\\'c1");
177  break;
178  case 'E':
179  fprintRTF("\\'c9");
180  break;
181  case 'I':
182  fprintRTF("\\'cd");
183  break;
184  case 'O':
185  fprintRTF("\\'d3");
186  break;
187  case 'U':
188  fprintRTF("\\'da");
189  break;
190  case 'a':
191  fprintRTF("\\'e1");
192  break;
193  case 'e':
194  fprintRTF("\\'e9");
195  break;
196  case 'i':
197  fprintRTF("\\'ed");
198  break;
199  case 'o':
200  fprintRTF("\\'f3");
201  break;
202  case 'u':
203  fprintRTF("\\'fa");
204  break;
205  case 'y':
206  fprintRTF("\\'fd");
207  break;
208  case 'Y':
209  fprintRTF("\\'dd");
210  break;
211  default:
212  if (strcmp(cParam,"\\i")==0) {
213  fprintRTF("\\'ed");
214  break;
215  }
216 
217  if (!g_processing_fields)
218  fprintRTF("{\\field{\\*\\fldinst EQ ");
219  fprintRTF("\\\\O(");
220  ConvertString(cParam);
221  fprintRTF("%c\\\\S(\\'b4))", g_field_separator);
222  if (!g_processing_fields)
223  fprintRTF("}{\\fldrslt }}");
224  break;
225 
226  }
227  free(cParam);
228 }
229 
230 void
232 /******************************************************************************
233  purpose: converts special symbols from LaTeX to RTF
234  ******************************************************************************/
235 {
236  char *cParam = getBraceParam();
237  if (cParam == NULL)
238  return;
239 
240  if (!g_processing_fields)
241  fprintRTF("{\\field{\\*\\fldinst EQ ");
242  fprintRTF("\\\\O(");
243  ConvertString(cParam);
244  fprintRTF("%c\\\\S(\\'af))", g_field_separator);
245  if (!g_processing_fields)
246  fprintRTF("}{\\fldrslt }}");
247 
248  free(cParam);
249 }
250 
251 void
253 /******************************************************************************
254  purpose: \^{o} and \hat{o} symbols from LaTeX to RTF
255  ******************************************************************************/
256 {
257  int num;
258  char *cParam = getBraceParam();
259  if (cParam == NULL)
260  return;
261 
262  switch (cParam[0]) {
263  case 'A':
264  fprintRTF("\\'c2");
265  break;
266  case 'E':
267  fprintRTF("\\'ca");
268  break;
269  case 'I':
270  fprintRTF("\\'ce");
271  break;
272  case 'O':
273  fprintRTF("\\'d4");
274  break;
275  case 'U':
276  fprintRTF("\\'db");
277  break;
278  case 'a':
279  fprintRTF("\\'e2");
280  break;
281  case 'e':
282  fprintRTF("\\'ea");
283  break;
284  case 'i':
285  fprintRTF("\\'ee");
286  break;
287  case 'o':
288  fprintRTF("\\'f4");
289  break;
290  case 'u':
291  fprintRTF("\\'fb");
292  break;
293 
294  default:
295  if (strcmp(cParam,"\\i")==0) {
296  fprintRTF("\\'ee");
297  break;
298  }
299  num = RtfFontNumber("MT Extra");
300  if (!g_processing_fields)
301  fprintRTF("{\\field{\\*\\fldinst EQ ");
302  fprintRTF("\\\\O(");
303  ConvertString(cParam);
304  fprintRTF("%c\\\\S({\\f%d\\'24}))", g_field_separator, num);
305  if (!g_processing_fields)
306  fprintRTF("}{\\fldrslt }}");
307  break;
308  }
309 
310  free(cParam);
311 }
312 
313 void
315 /******************************************************************************
316  purpose: converts \r accents from LaTeX to RTF
317  ******************************************************************************/
318 {
319  char *cParam;
320 
321  cParam = getBraceParam();
322  if (cParam == NULL)
323  return;
324 
325  switch (cParam[0]) {
326  case 'A':
327  fprintRTF("\\'c5");
328  break;
329 
330  case 'a':
331  fprintRTF("\\'e5");
332  break;
333 
334  case '\\':
335  if (strcmp(cParam, "\\i") == 0)
336  fprintRTF("\\'ee");
337  else
338  diagnostics(WARNING__, "Cannot put \\r on '%s'", cParam);
339  break;
340 
341  default:
342  if (!g_processing_fields)
343  fprintRTF("{\\field{\\*\\fldinst EQ ");
344  fprintRTF("\\\\O(");
345  ConvertString(cParam);
346  fprintRTF("%c\\\\S(\\'b0))", g_field_separator);
347  if (!g_processing_fields)
348  fprintRTF("}{\\fldrslt }}");
349  break;
350  }
351 
352  free(cParam);
353 }
354 
355 void
357 /******************************************************************************
358  purpose: converts \~{n} from LaTeX to RTF
359  ******************************************************************************/
360 {
361  int num;
362  char *cParam;
363 
364  cParam = getBraceParam();
365  if (cParam == NULL)
366  return;
367 
368  switch (cParam[0]) {
369  case 'A':
370  fprintRTF("\\'c3");
371  break;
372  case 'O':
373  fprintRTF("\\'d5");
374  break;
375  case 'a':
376  fprintRTF("\\'e3");
377  break;
378  case 'o':
379  fprintRTF("\\'f5");
380  break;
381  case 'n':
382  fprintRTF("\\'f1");
383  break;
384  case 'N':
385  fprintRTF("\\'d1");
386  break;
387  default:
388  num = RtfFontNumber("MT Extra");
389  if (!g_processing_fields) fprintRTF("{\\field{\\*\\fldinst EQ ");
390  fprintRTF("\\\\O(");
391  ConvertString(cParam);
392  fprintRTF("%c\\\\S({\\f%d\\'25}))", g_field_separator, num);
393  if (!g_processing_fields) fprintRTF("}{\\fldrslt }}");
394  break;
395  }
396  free(cParam);
397 }
398 
399 void
401 /*****************************************************************************
402  purpose: converts \c{c} from LaTeX to RTF
403  ******************************************************************************/
404 {
405  int down;
406  char *cParam = getBraceParam();
407  if (cParam == NULL)
408  return;
409 
410  switch (cParam[0]) {
411  case 'C':
412  fprintRTF("\\'c7");
413  break;
414  case 'c':
415  fprintRTF("\\'e7");
416  break;
417 
418  default:
419  down = CurrentFontSize() / 4;
420  if (!g_processing_fields)
421  fprintRTF("{\\field{\\*\\fldinst EQ ");
422  fprintRTF("\\\\O(");
423  ConvertString(cParam);
424  fprintRTF("%c\\dn%d\\'b8)", g_field_separator,down);
425  if (!g_processing_fields)
426  fprintRTF("}{\\fldrslt }}");
427  break;
428  }
429 
430  free(cParam);
431 }
432 
433 void
435 /*****************************************************************************
436  purpose: converts \vec{o} from LaTeX to RTF
437  ******************************************************************************/
438 {
439  int num;
440  int upsize;
441  char *cParam;
442 
443  cParam = getBraceParam();
444  if (cParam == NULL)
445  return;
446 
447  switch (cParam[0]) {
448  case 'a':
449  case 'c':
450  case 'e':
451  case 'g':
452  case 'i':
453  case 'j':
454  case 'm':
455  case 'n':
456  case 'o':
457  case 'p':
458  case 'q':
459  case 'r':
460  case 's':
461  case 'u':
462  case 'v':
463  case 'w':
464  case 'x':
465  case 'y':
466  case 'z':
467  upsize = (3 * CurrentFontSize()) / 8;
468  break;
469  default:
470  upsize = (CurrentFontSize() * 3) / 4;
471  }
472 
473  num = RtfFontNumber("MT Extra");
474 
475  if (!g_processing_fields)
476  fprintRTF("{\\field{\\*\\fldinst EQ ");
477  fprintRTF("\\\\O(");
478  ConvertString(cParam);
479  fprintRTF("%c\\\\S({\\up%d\\f%d\\'72}))", g_field_separator, upsize, num);
480  if (!g_processing_fields)
481  fprintRTF("}{\\fldrslt }}");
482  free(cParam);
483 }
484 
485 void
487 /*****************************************************************************
488  purpose: converts \u{o} and \breve{o} from LaTeX to RTF
489  there is no breve in codepage 1252
490  there is one \'f9 in the MacRoman, but that is not so portable
491  there is one in MT Extra, but the RTF parser for word mistakes
492  \'28 as a '(' and goes bananas. Therefore need the extra \\\\
493  the only solution is to encode with unicode --- perhaps later
494  Now we just fake it with a u
495  ******************************************************************************/
496 {
497  int upsize,num;
498  char *cParam;
499 
500  num = RtfFontNumber("MT Extra");
501  cParam = getBraceParam();
502  if (cParam == NULL)
503  return;
504 
505  upsize = CurrentFontSize()/2;
506  if (!g_processing_fields)
507  fprintRTF("{\\field{\\*\\fldinst EQ ");
508  fprintRTF("\\\\O(");
509  ConvertString(cParam);
510  fprintRTF("%c\\\\S({\\up%d\\f%d \\\\(}))", g_field_separator, upsize, num);
511  if (!g_processing_fields)
512  fprintRTF("}{\\fldrslt }}");
513  free(cParam);
514 }
515 
516 void
518 /******************************************************************************
519  purpose: converts chars with dots under from LaTeX to RTF
520  ******************************************************************************/
521 {
522  int dnsize;
523  char *cParam = getBraceParam();
524  if (cParam == NULL)
525  return;
526 
527  dnsize = (int) ((0.4 * CurrentFontSize()) + 0.45);
528 
529  if (!g_processing_fields)
530  fprintRTF("{\\field{\\*\\fldinst EQ ");
531  fprintRTF("\\\\O(");
532  ConvertString(cParam);
533  fprintRTF("%c\\\\S(\\dn%d\\'2e))", g_field_separator, dnsize);
534  if (!g_processing_fields)
535  fprintRTF("}{\\fldrslt }}");
536 
537  free(cParam);
538 }
539 
540 void
542 /******************************************************************************
543  purpose: converts \v from LaTeX to RTF
544  need something that looks like \\O(a,\\S(\f1\'da)) in RTF file
545  ******************************************************************************/
546 {
547  int num;
548  int upsize;
549  char *cParam;
550 
551  cParam = getBraceParam();
552  if (cParam == NULL)
553  return;
554 
555  upsize = (int) ((0.4 * CurrentFontSize()) + 0.45);
556  num = RtfFontNumber("Symbol");
557 
558  if (!g_processing_fields)
559  fprintRTF("{\\field{\\*\\fldinst EQ ");
560  fprintRTF("\\\\O(");
561  ConvertString(cParam);
562  fprintRTF("%c\\\\S({\\up%d\\f%d\\'da}))", g_field_separator, upsize, num);
563  if (!g_processing_fields)
564  fprintRTF("}{\\fldrslt }}");
565 
566  free(cParam);
567 }
568 
569 void
570 CmdDotChar(int code)
571 /******************************************************************************
572  purpose: converts \.{o} and \dot{o} from LaTeX to RTF
573  need something that looks like \\O(a,\\S(\f2\'26)) in RTF file
574  ******************************************************************************/
575 {
576  int num;
577  char *cParam;
578 
579  cParam = getBraceParam();
580  if (cParam == NULL)
581  return;
582 
583  num = RtfFontNumber("MT Extra");
584 
585  if (!g_processing_fields)
586  fprintRTF("{\\field{\\*\\fldinst EQ ");
587  fprintRTF("\\\\O(");
588  ConvertString(cParam);
589  fprintRTF("%c\\\\S({\\f%d\\'26}))", g_field_separator, num);
590  if (!g_processing_fields)
591  fprintRTF("}{\\fldrslt }}");
592 
593  free(cParam);
594 }
595 
596 void
598 /******************************************************************************
599  purpose: converts \.{o} and \dot{o} from LaTeX to RTF
600  need something that looks like \\O(a,\\S(\f2\'26)) in RTF file
601  ******************************************************************************/
602  {
603  char *cParam;
604 
605  cParam = getBraceParam();
606  if (cParam == NULL)
607  return;
608 
609  if (cParam[0]) {
610  if (!g_processing_fields)
611  fprintRTF("{\\field{\\*\\fldinst EQ ");
612  fprintRTF("\\\\O(");
613  ConvertString(cParam);
614  fprintRTF("%c_)", g_field_separator);
615  if (!g_processing_fields)
616  fprintRTF("}{\\fldrslt }}");
617  }
618  free(cParam);
619 }
620 
621 void
622 CmdDotlessChar(int code)
623 /******************************************************************************
624  purpose: converts \i and \j to 'i' and 'j'
625  ******************************************************************************/
626 {
627  if (code==0)
628  fprintRTF("i");
629  else
630  fprintRTF("j");
631 }
632 
633 void
634 CmdChar(int code)
635 {
636  char cThis;
637  int num;
638  int symfont = RtfFontNumber("Symbol");
639 
640  cThis = getNonSpace();
641  if (cThis != '\'') { ungetTexChar(cThis); return; }
642 
643  num = 64 * ((int) getTexChar() - (int) '0');
644  num += 8 * ((int) getTexChar() - (int) '0');
645  num += ((int) getTexChar() - (int) '0');
646 
647  switch (num) {
648  case 0: fprintRTF("{\\f%d G}", symfont); /* Gamma */
649  break;
650 
651  case 1: fprintRTF("{\\f%d D}", symfont); /* Delta */
652  break;
653 
654  case 2: fprintRTF("{\\f%d Q}", symfont); /* Theta */
655  break;
656 
657  case 3: fprintRTF("{\\f%d L}", symfont); /* Lambda */
658  break;
659 
660  case 4: fprintRTF("{\\f%d X}", symfont); /* Xi */
661  break;
662 
663  case 5: fprintRTF("{\\f%d P}", symfont); /* Pi */
664  break;
665 
666  case 6: fprintRTF("{\\f%d S}", symfont); /* Sigma */
667  break;
668 
669  case 7: fprintRTF("{\\f%d U}", symfont); /* Upsilon */
670  break;
671 
672  case 8: fprintRTF("{\\f%d F}", symfont); /* Phi */
673  break;
674 
675  case 9: fprintRTF("{\\f%d Y}", symfont); /* Psi */
676  break;
677 
678  case 10: fprintRTF("{\\f%d W}", symfont); /* Omega */
679  break;
680 
681  case 11: fprintRTF("ff");
682  break;
683 
684  case 12: fprintRTF("fi");
685  break;
686 
687  case 13: fprintRTF("fl");
688  break;
689 
690  case 14: fprintRTF("ffi");
691  break;
692 
693  case 15: fprintRTF("ffl");
694  break;
695 
696  case 16: fprintRTF("i"); /* Dotless i */
697  break;
698 
699  case 17: fprintRTF("j"); /* Dotless j */
700  break;
701 
702  case 18: fprintRTF("`");
703  break;
704 
705  case 19: fprintRTF("'");
706  break;
707 
708  case 20: fprintRTF("v");
709  break;
710 
711  case 21: fprintRTF("u");
712  break;
713 
714  case 22: fprintRTF("-"); /* overbar */
715  break;
716 
717  case 23: fprintRTF("{\\f%d \\'b0}", symfont); /* degree */
718  break;
719 
720  case 24: fprintRTF("\\'b8"); /*cedilla*/
721  break;
722 
723  case 25: fprintRTF("\\'df"); /**/
724  break;
725 
726  case 26: fprintRTF("\\'e6"); /* ae */
727  break;
728 
729  case 27: fprintRTF("\\'8c"); /* oe */
730  break;
731 
732  case 28: fprintRTF("\\'f8"); /*oslash*/
733  break;
734 
735  case 29: fprintRTF("\\'c6"); /*AE*/
736  break;
737 
738  case 30: fprintRTF("\\'8c"); /*OE*/
739  break;
740 
741  case 31: fprintRTF("\\'d8"); /* capital O with stroke*/
742  break;
743 
744  case 32: fprintRTF(" "); /*space differs with font*/
745  break;
746 
747  case 60: fprintRTF("<"); /* less than differs with font*/
748  break;
749 
750  case 62: fprintRTF(">"); /* greater than differs with font*/
751  break;
752 
753  case 123: fprintRTF("\\{"); /* open brace differs with font*/
754  break;
755 
756  case 124: fprintRTF("\\\\"); /* backslash differs with font*/
757  break;
758 
759  case 125: fprintRTF("\\}"); /*close brace differs with font*/
760  break;
761 
762  case 127: fprintRTF("\\'a8"); /*diaeresis differs with font*/
763  break;
764 
765  default:
766  putRtfChar((char) num);
767  break;
768  }
769 }
770 
771 void
772 TeXlogo()
773 /******************************************************************************
774  purpose : prints the Tex logo in the RTF-File (D Taupin)
775  ******************************************************************************/
776 {
777  float DnSize;
778  int dnsize;
779 
780  DnSize = 0.3 * CurrentFontSize();
781  dnsize = (int) (DnSize + 0.45);
782  fprintRTF("T{\\dn%d E}X", dnsize);
783 }
784 
785 void
786 LaTeXlogo()
787 /******************************************************************************
788  purpose : prints the LaTeX logo in the RTF-File (D Taupin)
789  ******************************************************************************/
790 {
791  float FloatFsize;
792  int upsize, Asize;
793 
794  if (CurrentFontSize() > 14)
795  FloatFsize = 0.8 * CurrentFontSize();
796  else
797  FloatFsize = 0.9 * CurrentFontSize();
798  Asize = (int) (FloatFsize + 0.45);
799 
800  upsize = (int) (0.25 * CurrentFontSize() + 0.45);
801  fprintRTF("L{\\up%d\\fs%d A}", upsize, Asize);
802  TeXlogo();
803 }
804 
805 void
806 CmdLogo(int code)
807 /******************************************************************************
808  purpose : converts the LaTeX, TeX, SLiTex, etc logos to RTF
809  ******************************************************************************/
810 {
811  int font_num, dnsize;
812  float FloatFsize;
813 
815  fprintRTF("{\\plain ");
816 
817  switch (code) {
818  case CMD_TEX:
819  TeXlogo();
820  break;
821 
822  case CMD_LATEX:
823  LaTeXlogo();
824  break;
825 
826  case CMD_SLITEX:
827  fprintRTF("{\\scaps Sli}");
828  TeXlogo();
829  break;
830 
831  case CMD_BIBTEX:
832  fprintRTF("{\\scaps Bib}");
833  TeXlogo();
834  break;
835 
836  case CMD_LATEXE:
837  LaTeXlogo();
838  if (CurrentFontSize() > 14) {
839  FloatFsize = 0.75 * CurrentFontSize();
840  } else {
841  FloatFsize = (float) CurrentFontSize();
842  };
843  dnsize = (int) (0.3 * CurrentFontSize() + 0.45);
844  font_num = RtfFontNumber("Symbol");
845  fprintRTF("2{\\dn%d\\f%d e}", dnsize, font_num);
846  break;
847 
848  case CMD_AMSTEX:
849  fprintRTF("{\\i AmS}-"); /* should be calligraphic */
850  TeXlogo();
851  break;
852 
853  case CMD_AMSLATEX:
854  fprintRTF("{\\i AmS}-"); /* should be calligraphic */
855  LaTeXlogo();
856  break;
857 
858  case CMD_LYX:
859  dnsize = (int) (0.3 * CurrentFontSize() + 0.45);
860  fprintRTF("L{\\dn%d Y}X", dnsize);
861  break;
862  }
863  fprintRTF("}");
864 }
865 
866 void
867 CmdCzechAbbrev(int code)
868 /******************************************************************************
869  purpose: only handles \uv{quote} at the moment
870  ******************************************************************************/
871 {
872  char *quote;
873 
875  fprintRTF(" \\'84");
877  free(quote);
878  fprintRTF("\\ldblquote ");
879  return;
880 }
881 
882 void
884 /******************************************************************************
885  purpose: makes \\ier, \\ieme, etc
886  ******************************************************************************/
887 {
888  float FloatFsize;
889  int up, size;
890  char *fuptext;
891 
892  if (code == INFERIEURA) {fprintRTF("<"); return;}
893  if (code == SUPERIEURA) {fprintRTF(">"); return;}
894  if (code == FRENCH_LQ) {fprintRTF("\\lquote"); return;}
895  if (code == FRENCH_RQ) {fprintRTF("\\rquote"); return;}
896  if (code == FRENCH_LQQ) {fprintRTF("\\ldblquote"); return;}
897  if (code == FRENCH_RQQ) {fprintRTF("\\rdblquote"); return;}
898  if (code == POINT_VIRGULE) {fprintRTF(";"); return;}
899  if (code == POINT_EXCLAMATION) {fprintRTF("!"); return;}
900  if (code == POINT_INTERROGATION) {fprintRTF("?"); return;}
901  if (code == DITTO_MARK) {fprintRTF("\""); return;}
902  if (code == DEUX_POINTS) {fprintRTF(":"); return;}
903  if (code == LCS || code == FCS) {
904  char *abbev=getBraceParam();
905  fprintRTF("{\\scaps ");
906  ConvertString(abbev);
907  free(abbev);
908  fprintRTF("}");
909  return;
910  }
911 
912  if (code == NUMERO) fprintRTF("n");
913  if (code == NUMEROS) fprintRTF("n");
914  if (code == CNUMERO) fprintRTF("N");
915  if (code == CNUMEROS) fprintRTF("N");
916  if (code == PRIMO) fprintRTF("1");
917  if (code == SECUNDO) fprintRTF("2");
918  if (code == TERTIO) fprintRTF("3");
919  if (code == QUARTO) fprintRTF("4");
920 
921  FloatFsize = (float) CurrentFontSize();
922 
923  if(FloatFsize > 14) FloatFsize *= 0.75;
924 
925  up = (int) (0.3*FloatFsize+0.45);
926  size = (int) (FloatFsize+0.45);
927 
928  fprintRTF("{\\fs%d\\up%d ",size ,up);
929  switch(code)
930  {
931  case NUMERO : fprintRTF("o"); break;
932  case CNUMERO : fprintRTF("o"); break;
933  case NUMEROS : fprintRTF("os"); break;
934  case CNUMEROS : fprintRTF("os"); break;
935  case PRIMO : fprintRTF("o"); break;
936  case SECUNDO : fprintRTF("o"); break;
937  case TERTIO : fprintRTF("o"); break;
938  case QUARTO : fprintRTF("o"); break;
939  case IERF: fprintRTF("er"); break;
940  case IERSF: fprintRTF("ers"); break;
941  case IEMEF: fprintRTF("e"); break;
942  case IEMESF: fprintRTF("es"); break;
943  case IEREF: fprintRTF("re"); break;
944  case IERESF: fprintRTF("res"); break;
945  case FUP:
946  fuptext=getBraceParam();
947  ConvertString(fuptext);
948  free(fuptext);
949  break;
950  }
951 
952  fprintRTF("}");
953 }
954 
955 void CmdCyrillicChar(int code)
956 /******************************************************************************
957  * purpose : insert cyrillic character into RTF stream
958  * ******************************************************************************/
959 {
960  int n;
961 
962  if (code<=0 || code >= 255) return;
963 
965 
966  if (n>=0)
967  fprintRTF("{\\f%d\\\'%.2X}", n, code);
968  else /* already using Cyrillic Font */
969  fprintRTF("\\\'%.2X", code);
970 }
971 
972 void CmdCyrillicStrChar(char *s)
973 /******************************************************************************
974  * purpose : insert cyrillic character into RTF stream
975  * ******************************************************************************/
976 {
977  int n;
978 
979  if (s==NULL || strlen(s)!=2) return;
980 
982 
983  if (n>=0)
984  fprintRTF("{\\f%d\\\'%s}", n, s);
985  else /* already using Cyrillic Font */
986  fprintRTF("\\\'%s", s);
987 }
988 
void CmdCedillaChar(int code)
Definition: chars.c:400
void CmdRApostrophChar(int code)
Definition: chars.c:165
void CmdTildeChar(int code)
Definition: chars.c:356
void LaTeXlogo()
void CmdVecChar(int code)
Definition: chars.c:434
void CmdOaccentChar(int code)
Definition: chars.c:314
void CmdHatChar(int code)
Definition: chars.c:252
void CmdLApostrophChar(int code)
Definition: chars.c:104
void CmdUnderdotChar(int code)
Definition: chars.c:517
void TeXlogo()
void CmdUmlauteChar(int code)
Definition: chars.c:41
void CmdMacronChar(int code)
Definition: chars.c:231
void CmdHacekChar(int code)
Definition: chars.c:541
void CmdBreveChar(int code)
Definition: chars.c:486
#define CMD_AMSTEX
Definition: chars.h:6
#define CMD_LYX
Definition: chars.h:8
#define IEMESF
Definition: chars.h:40
#define DEUX_POINTS
Definition: chars.h:62
#define QUARTO
Definition: chars.h:49
#define IERESF
Definition: chars.h:38
#define DITTO_MARK
Definition: chars.h:61
#define CMD_LATEX
Definition: chars.h:2
#define CNUMERO
Definition: chars.h:44
#define CMD_SLITEX
Definition: chars.h:3
#define POINT_INTERROGATION
Definition: chars.h:60
#define FUP
Definition: chars.h:50
#define IERF
Definition: chars.h:35
#define SUPERIEURA
Definition: chars.h:53
#define PRIMO
Definition: chars.h:46
#define IEMEF
Definition: chars.h:39
#define NUMERO
Definition: chars.h:42
#define FRENCH_RQ
Definition: chars.h:55
#define POINT_VIRGULE
Definition: chars.h:58
#define FRENCH_LQQ
Definition: chars.h:56
void CmdCyrillicStrChar(char *s)
#define CMD_BIBTEX
Definition: chars.h:4
#define NUMEROS
Definition: chars.h:43
void CmdCzechAbbrev(int code)
#define POINT_EXCLAMATION
Definition: chars.h:59
void CmdFrenchAbbrev(int code)
void CmdLogo(int code)
#define CNUMEROS
Definition: chars.h:45
#define FRENCH_LQ
Definition: chars.h:54
#define FCS
Definition: chars.h:64
void CmdChar(int code)
#define FRENCH_RQQ
Definition: chars.h:57
void CmdCyrillicChar(int code)
#define CMD_LATEXE
Definition: chars.h:5
#define CMD_TEX
Definition: chars.h:1
#define CMD_AMSLATEX
Definition: chars.h:7
void CmdDotChar(int code)
#define LCS
Definition: chars.h:63
void CmdUnderbarChar(int code)
#define IEREF
Definition: chars.h:36
#define TERTIO
Definition: chars.h:48
void CmdDotlessChar(int code)
#define IERSF
Definition: chars.h:37
#define INFERIEURA
Definition: chars.h:52
#define SECUNDO
Definition: chars.h:47
#define n
Definition: t4ht.c:1290
#define MODE_HORIZONTAL
Definition: convert.h:2
#define free(a)
Definition: decNumber.cpp:310
int strcmp()
Definition: coll.cpp:143
#define s
Definition: afcover.h:80
#define NULL
Definition: ftobjs.h:61
int num
Definition: disdvi.c:621
void ConvertString(char *string)
Definition: convert.c:103
void SetTexMode(int mode)
Definition: convert.c:78
void diagnostics(int level, char *format,...)
Definition: main.c:469
void fprintRTF(char *format,...)
Definition: main.c:722
int g_processing_fields
Definition: main.c:85
char g_field_separator
Definition: main.c:105
void putRtfChar(char cThis)
Definition: main.c:703
#define WARNING__
Definition: main.h:32
char quote
Definition: exvar.h:12
int CurrentCyrillicFontFamily(void)
Definition: l2r_fonts.c:619
int RtfFontNumber(char *Fname)
Definition: l2r_fonts.c:103
int CurrentFontSize(void)
Definition: l2r_fonts.c:665
char getTexChar(void)
char getNonSpace(void)
void ungetTexChar(char c)
char * getBraceParam(void)
static int size
Definition: ppmlabel.c:24
Definition: inftrees.h:24
*job_name strlen((char *) job_name) - 4)
up
Definition: tex4ht.c:2558
return() int(((double) *(font_tbl[cur_fnt].wtbl+(int)(*(font_tbl[cur_fnt].char_wi+(int)(ch - font_tbl[cur_fnt].char_f)% 256)))/(double)(1L<< 20)) *(double) font_tbl[cur_fnt].scale)