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)  

l2r_fonts.c
Go to the documentation of this file.
1 /* l2r_fonts.c - LaTeX commands that alter font size, style, or face
2 
3 Copyright (C) 2001-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 Authors:
22  2001-2002 Scott Prahl
23 */
24 
25 /*
26  All changes to font size, font style, and font face are
27  handled in this file. Explicit changing of font characteristics
28  should not be done elsewhere.
29 
30  Font handling in LaTeX uses five independent parameters
31 
32  * Font encoding --- OT1, OT
33  * Font family --- roman, typewriter, sans serif
34  * Font size --- normal, large, ...
35  * Font shape --- upright, italics, small caps
36  * Font series --- medium, bold
37 
38  Font changes in LaTeX use commands that fall into three categories.
39 
40  commands that are independent of the previous state, e.g.,
41  {\sc before {\it some text}} will typeset in "some text"
42  in italics
43 
44  commands that add to the previous state {\sc before \textit{some text}}
45  will typeset "some text" in italic small caps (if available)
46 
47  commands that are affected by the previous state {\it before \emph{some text}}
48  will typeset "some text" in an upright font
49 
50  RTF has no commands to directly emulate this third type of command. The first
51  type is readily simulated by resetting the font properties before setting the
52  desired setting. The second type of command is the normal way that RTF handles
53  fonts, and therefore is not a problem.
54 
55  Limiting the extent of font changes is handled by braces in the RTF file. This
56  leads to the following problem,
57 
58  \textit{some text {\em roman text} more italic text {\em more roman text}}
59 
60  which should be translated to
61 
62  {\i some text {\i0 roman text} more italic text {\i0 more roman text}}
63 
64  when \em is encountered by latex2rtf, the extent of the emphasis is unknown:
65  it may continue to the next brace, it may continue to the end of an environment
66  \end{center}, or it may continue to the end of the document. In the example above,
67  the text will be reset to italics by the first closing brace. This is easy, but
68  the problem is that the at the next \em, it is necessary to know that the font has
69  been changed back.
70 
71  Consequently, it is necessary to know the current latex font setting *for each
72  RTF brace level*. The easiest way to do this is to filter everything fprintf'ed
73  to the RTF file
74 
75 */
76 
77 #include <stdlib.h>
78 #include <string.h>
79 #include <ctype.h>
80 
81 #include "main.h"
82 #include "convert.h"
83 #include "l2r_fonts.h"
84 #include "funct1.h"
85 #include "commands.h"
86 #include "cfg.h"
87 #include "parser.h"
88 #include "stack.h"
89 
90 typedef struct RtfFontInfoType
91 {
92  int family;
93  int shape;
94  int series;
95  int size;
97 
98 #define MAX_FONT_INFO_DEPTH 301
100 static int FontInfoDepth=0;
101 
102 int
103 RtfFontNumber(char *Fname)
104 /****************************************************************************
105  * purpose: returns the RTF font number from an RTF font name
106  example: RtfFontNumber("Times")
107  ****************************************************************************/
108 {
109  int num = 0;
110  ConfigEntryT **config_handle = CfgStartIterate(FONT_A);
111 
112  while ((config_handle = CfgNext(FONT_A, config_handle)) != NULL) {
113  diagnostics(4,"font name =%s", (*config_handle)->RtfCommand);
114  if (strcmp((*config_handle)->RtfCommand, Fname) == 0) {
115  return num+3;
116  }
117  num++;
118  }
119  return TexFontNumber("Roman"); /* default font */
120 }
121 
122 int
123 TexFontNumber(char *Fname)
124 /****************************************************************************
125  purpose: returns the RTF font number for a particular LaTeX font
126  example: TexFontNumber("Roman")
127  ****************************************************************************/
128 {
129  return SearchRtfIndex(Fname, FONT_A)+3;
130 }
131 
132 void
134 /******************************************************************************
135  purpose: selects the appropriate font family
136  F_FAMILY_ROMAN for \rmfamily
137  F_FAMILY_ROMAN_1 for \rm
138  F_FAMILY_ROMAN_2 for \textrm{...}
139  F_FAMILY_ROMAN_3 for \begin{rmfamily} or \end{rmfamily}
140  ******************************************************************************/
141 {
142  char *s;
143  int num, true_code;
144 
145  true_code = code & ~~ON;
146 
147  diagnostics(4,"CmdFontFamily (before) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
150  RtfFontInfo[FontInfoDepth].series);
151 
152  if (!(code & ON) &&
153  (true_code == F_FAMILY_CALLIGRAPHIC_3 || true_code ==F_FAMILY_TYPEWRITER_3 ||
154  true_code == F_FAMILY_SANSSERIF_3 || true_code == F_FAMILY_ROMAN_3 ||
155  true_code ==F_FAMILY_TYPEWRITER_4 ||
156  true_code == F_FAMILY_SANSSERIF_4 || true_code == F_FAMILY_ROMAN_4 ) )
157  return;
158 
159  switch (true_code) {
160  case F_FAMILY_ROMAN:
161  case F_FAMILY_ROMAN_1:
162  case F_FAMILY_ROMAN_2:
163  case F_FAMILY_ROMAN_3:
164  case F_FAMILY_ROMAN_4:
165  num = TexFontNumber("Roman");
166  break;
167 
168  case F_FAMILY_SANSSERIF:
173  num = TexFontNumber("Sans Serif");
174  break;
175 
176  case F_FAMILY_TYPEWRITER:
181  num = TexFontNumber("Typewriter");
182  break;
183 
188  num = TexFontNumber("Calligraphic");
189  break;
190  }
191 
192 
193  switch (true_code) {
194  case F_FAMILY_ROMAN:
195  case F_FAMILY_SANSSERIF:
196  case F_FAMILY_TYPEWRITER:
198  case F_FAMILY_ROMAN_3:
202  fprintRTF("\\f%d ", num);
203  break;
204 
205  case F_FAMILY_ROMAN_1:
208  case F_FAMILY_ROMAN_4:
211  fprintRTF("\\i0\\scaps0\\b0\\f%d ", num);
212  break;
213 
214  case F_FAMILY_ROMAN_2:
218  fprintRTF("{\\f%d ", num);
219  s = getBraceParam();
220  ConvertString(s);
221  free(s);
222  fprintRTF("}");
223  break;
224  }
225 
226  diagnostics(4,"CmdFontFamily (after) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
229  RtfFontInfo[FontInfoDepth].series);
230 }
231 
232 void
234 /****************************************************************************
235  purpose : sets the font to upright, italic, or small caps
236  F_SHAPE_ITALIC for \itshape
237  F_SHAPE_ITALIC_1 for \it
238  F_SHAPE_ITALIC_2 for \textit{...}
239  F_SHAPE_ITALIC_3 for \begin{itshape}
240  F_SHAPE_ITALIC_4 for \begin{it}
241 
242  ****************************************************************************/
243 {
244  int true_code = code & ~~ON;
245 
246  diagnostics(4,"CmdFontShape (before) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
249  RtfFontInfo[FontInfoDepth].series);
250 
251  /* \end{itshape}, \end{sc} ... */
252  if (!(code & ON) &&
253  (true_code == F_SHAPE_UPRIGHT_3 || true_code ==F_SHAPE_ITALIC_3 ||
254  true_code == F_SHAPE_SLANTED_3 || true_code == F_SHAPE_CAPS_3 ||
255  true_code ==F_SHAPE_ITALIC_4 ||
256  true_code == F_SHAPE_SLANTED_4 || true_code == F_SHAPE_CAPS_4 ) )
257  return;
258 
259  switch (true_code) {
260 
261  case F_SHAPE_UPRIGHT:
262  case F_SHAPE_UPRIGHT_3: fprintRTF("\\i0\\scaps0 "); break;
263 
264  case F_SHAPE_UPRIGHT_1: fprintRTF("\\i0\\scaps0\\b0 "); break;
265 
266  case F_SHAPE_UPRIGHT_2: fprintRTF("{\\i0\\b0\\scaps0 "); break;
267 
268  case F_SHAPE_SLANTED:
269  case F_SHAPE_ITALIC: fprintRTF("\\scaps0\\i "); break;
270 
271  case F_SHAPE_SLANTED_1:
272  case F_SHAPE_ITALIC_1: fprintRTF("\\scaps0\\b0\\i "); break;
273 
274  case F_SHAPE_SLANTED_2:
275  case F_SHAPE_ITALIC_2: fprintRTF("{\\i "); break;
276 
277  case F_SHAPE_SLANTED_3:
278  case F_SHAPE_ITALIC_3: fprintRTF("\\scaps0\\i "); break;
279 
280  case F_SHAPE_SLANTED_4:
281  case F_SHAPE_ITALIC_4: fprintRTF("\\scaps0\\b0\\i "); break;
282 
283  case F_SHAPE_CAPS:
284  case F_SHAPE_CAPS_3: fprintRTF("\\scaps "); break;
285 
286  case F_SHAPE_CAPS_1:
287  case F_SHAPE_CAPS_4: fprintRTF("\\i0\\b0\\scaps "); break;
288 
289  case F_SHAPE_CAPS_2: fprintRTF("{\\scaps "); break;
290  }
291 
292  if (true_code == F_SHAPE_UPRIGHT_2 || true_code == F_SHAPE_ITALIC_2 ||
293  true_code == F_SHAPE_SLANTED_2 || true_code == F_SHAPE_CAPS_2)
294  {
295  char *s;
296  s = getBraceParam();
297  ConvertString(s);
298  fprintRTF("}");
299  free(s);
300  }
301 
302  diagnostics(4,"CmdFontShape (after) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
305  RtfFontInfo[FontInfoDepth].series);
306 }
307 
308 void
310 /****************************************************************************
311  purpose : sets the font weight to medium or bold
312 
313  F_SERIES_BOLD for \bfseries ...
314  F_SERIES_BOLD_1 for \bf ...
315  F_SERIES_BOLD_2 for \textbf{...}
316  F_SERIES_BOLD_3 for \begin{bfseries} ... \end{bfseries}
317 
318  ****************************************************************************/
319 {
320  int true_code = code & ~~ON;
321 
322  diagnostics(4,"CmdFontSeries (before) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
325  RtfFontInfo[FontInfoDepth].series);
326 
327  /* either \end{bfseries} or \end{mdseries} */
328  if ((true_code == F_SERIES_MEDIUM_3 || true_code == F_SERIES_BOLD_3 ||
329  true_code == F_SERIES_BOLD_4) && !(code & ON))
330  return;
331 
332 
333  switch (code) {
334  case F_SERIES_MEDIUM_3:
335  case F_SERIES_MEDIUM: fprintRTF("\\b0 ");
336  break;
337 
338  case F_SERIES_MEDIUM_1:
339  fprintRTF("\\i0\\scaps0\\b0 ");
340  break;
341 
342  case F_SERIES_MEDIUM_2:
343  fprintRTF("{\\b0 ");
344  break;
345 
346  case F_SERIES_BOLD:
347  case F_SERIES_BOLD_3: fprintRTF("\\b ");
348  break;
349 
350  case F_SERIES_BOLD_1:
351  case F_SERIES_BOLD_4:
352  fprintRTF("\\i0\\scaps0\\b ");
353  break;
354 
355  case F_SERIES_BOLD_2:
356  fprintRTF("{\\b ");
357  break;
358  }
359 
360  if (true_code == F_SERIES_BOLD_2 || true_code == F_SERIES_MEDIUM_2){
361  char *s;
362  s = getBraceParam();
363  ConvertString(s);
364  fprintRTF("}");
365  free(s);
366  }
367 
368  diagnostics(4,"CmdFontShape (after) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
371  RtfFontInfo[FontInfoDepth].series);
372 }
373 
374 void
376 /******************************************************************************
377  purpose : handles LaTeX commands that change the font size
378 ******************************************************************************/
379 {
380  int scaled_size;
381 
382  diagnostics(4,"CmdFontSize (before) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
385  RtfFontInfo[FontInfoDepth].series);
386 
387  if (code == F_SMALLER)
388  scaled_size = (int) (CurrentFontSize() / 1.2 + 0.5);
389  else if (code == F_LARGER)
390  scaled_size = (int) (CurrentFontSize() * 1.2 + 0.5);
391  else
392  scaled_size = (int) (code * DefaultFontSize() / 20.0 + 0.5);
393 
394  fprintRTF("\\fs%d ", scaled_size);
395 
396  diagnostics(4,"CmdFontSize (after) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
399  RtfFontInfo[FontInfoDepth].series);
400 }
401 
402 void
404 /****************************************************************************
405  purpose: LaTeX commands \em, \emph, and \begin{em} ... \end{em}
406 
407  the \emph{string} construction is handled by \textit{string} or \textup{string}
408 
409  {\em string} should be properly localized by brace mechanisms
410 
411  \begin{em} ... \end{em} will be localized by environment mechanisms
412 
413  F_EMPHASIZE_1 for \em ...
414  F_EMPHASIZE_2 for \emph{...}
415  F_EMPHASIZE_3 for \begin{em} ... \end{em}
416  ******************************************************************************/
417 {
418  int true_code = code & ~~ON;
419 
420  diagnostics(4,"CmdEmphasize (before) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
423  RtfFontInfo[FontInfoDepth].series);
424 
425  if (true_code == F_EMPHASIZE_3 && !(code & ON))
426  return;
427 
428  if (true_code == F_EMPHASIZE_2) {
429 
432  else
434 
435  } else {
436 
438  fprintRTF("\\i ");
439  else
440  fprintRTF("\\i0 ");
441 
442  }
443 
444  diagnostics(4,"CmdEmphasize (after) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
447  RtfFontInfo[FontInfoDepth].series);
448 
449 }
450 
451 void
453 /****************************************************************************
454  purpose: handle \underline{text}
455  ******************************************************************************/
456 {
457  char *s;
458  diagnostics(4,"Entering CmdUnderline");
459 
460  fprintRTF("{\\ul ");
461  s = getBraceParam();
462  ConvertString(s);
463  free(s);
464  fprintRTF("}");
465  diagnostics(4,"Exiting CmdUnderline");
466 }
467 
468 void
470 /****************************************************************************
471  purpose: handle \textnormal{text} {\normalfont ...} commands
472 
473  F_TEXT_NORMAL for \normalfont ...
474  F_TEXT_NORMAL_1
475  F_TEXT_NORMAL_2 for \textnormal{...}
476  F_TEXT_NORMAL_3 for \begin{normalfont} ... \end{normalfont}
477 
478  ******************************************************************************/
479 {
480  int true_code = code & ~~ON;
481 
482  diagnostics(4,"CmdTextNormal (before) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
485  RtfFontInfo[FontInfoDepth].series);
486 
487  if (true_code == F_TEXT_NORMAL_3 && !(code & ON))
488  return;
489 
490  if (code==F_TEXT_NORMAL_2)
491  fprintRTF("{");
492 
495 
498 
499  if (CurrentFontSize() != DefaultFontSize())
501 
504 
505  if (code==F_TEXT_NORMAL_2) {
506  char *s;
507  s = getBraceParam();
508  ConvertString(s);
509  free(s);
510  fprintRTF("}");
511  }
512 
513  diagnostics(4,"CmdTextNormal (after) depth=%d, family=%d, size=%d, shape=%d, series=%d",\
516  RtfFontInfo[FontInfoDepth].series);
517 }
518 
519 static bool
520 strstart(char *text, char *str)
521 /* returns true if text begins with str */
522 {
523  while (*str && (*str == *text)){
524  str++;
525  text++;
526  }
527 
528  if (*str)
529  return FALSE;
530  else
531  return TRUE;
532 }
533 
534 static bool
535 strstartnum(char *text, char *str, int *num)
536 /* returns true if text begins with str and followed by an integer*/
537 {
538  char * numptr;
539  *num = 0;
540 
541  if (!strstart(text,str))
542  return FALSE;
543 
544  text += strlen(str);
545  numptr = text;
546 
547  while (isdigit((int)*numptr)) {
548  *num = (*num * 10) + (*numptr - '0');
549  numptr++;
550  }
551 
552  if (numptr == text)
553  return FALSE;
554  else
555  return TRUE;
556 }
557 
558 
559 void
560 InitializeDocumentFont(int family, int size, int shape, int series)
561 /******************************************************************************
562  purpose: Initialize the basic font properties for a document
563  pass -1 to avoid setting any parameter
564  ******************************************************************************/
565 {
566  if (size >= 0)
567  RtfFontInfo[0].size = size;
568  if (family >= 0)
570  if (shape >= 0)
571  RtfFontInfo[0].shape = shape;
572  if (series >= 0)
573  RtfFontInfo[0].series = series;
574 
575  diagnostics(4,"InitializeDocumentFont family=%d, size=%d, shape=%d, series=%d",\
576  RtfFontInfo[0].family, RtfFontInfo[0].size, RtfFontInfo[0].shape,\
577  RtfFontInfo[0].series);
578 }
579 
580 int
582 {
583  diagnostics(4,"DefaultFontFamily -- family=%d", RtfFontInfo[0].family);
584  return RtfFontInfo[0].family;
585 }
586 
587 int
589 {
590  diagnostics(4,"DefaultFontSize -- size=%d", RtfFontInfo[0].size);
591  return RtfFontInfo[0].size;
592 }
593 
594 int
596 {
597  diagnostics(4,"DefaultFontShape -- shape=%d", RtfFontInfo[0].shape);
598  return RtfFontInfo[0].shape;
599 }
600 
601 int
603 {
604  diagnostics(4,"DefaultFontSeries -- series=%d", RtfFontInfo[0].series);
605  return RtfFontInfo[0].series;
606 }
607 
608 int
610 /******************************************************************************
611  purpose: returns the current RTF family
612  ******************************************************************************/
613 {
614  diagnostics(4,"CurrentFontFamily -- family=%d", RtfFontInfo[FontInfoDepth].family);
616 }
617 
618 int
620 /******************************************************************************
621  purpose: returns the cyrillic font that should be used ...
622  if the current font is cyrillic font then -1 is returned
623  ******************************************************************************/
624 {
625  int num,i;
626  char *font_type;
627  ConfigEntryT **font_handle;
628 
630 
631 /* obtain name and type of current active font */
632  font_handle = CfgStartIterate(FONT_A);
633  for (i=0; i<=num-3; i++)
634  font_handle = CfgNext(FONT_A, font_handle);
635 
636  font_type = (char *) (*font_handle)->TexCommand;
637  diagnostics(6,"CurrentCyrillicFontFamily current active font type =<%s>", font_type);
638 
639  if (strncmp(font_type, "Cyrillic", 8)==0)
640  return -1;
641 
642  if (strcmp(font_type, "Slanted")==0)
643  return TexFontNumber("Cyrillic Slanted");
644 
645  if (strcmp(font_type, "Sans Serif")==0)
646  return TexFontNumber("Cyrillic Sans Serif");
647 
648  if (strcmp(font_type, "Typewriter")==0)
649  return TexFontNumber("Cyrillic Typewriter");
650 
651  return TexFontNumber("Cyrillic Roman");
652 }
653 
654 int
656 /******************************************************************************
657  purpose: returns the current RTF shape
658  ******************************************************************************/
659 {
660  diagnostics(4,"CurrentFontShape -- shape=%d", RtfFontInfo[FontInfoDepth].shape);
662 }
663 
664 int
666 /******************************************************************************
667  purpose: returns the current RTF size
668  ******************************************************************************/
669 {
670  diagnostics(4,"CurrentFontSize -- size=%d", RtfFontInfo[FontInfoDepth].size);
671 
673 }
674 
675 int
677 /******************************************************************************
678  purpose: returns the current RTF series
679  ******************************************************************************/
680 {
681  diagnostics(4,"CurrentFontSeries -- series=%d", RtfFontInfo[FontInfoDepth].series);
683 }
684 
685 void
687 {
689  diagnostics(ERROR, "FontInfoDepth too large, cannot PushFontSettings()!");
690 
695  FontInfoDepth++;
696 
697  diagnostics(6,"PushFontSettings depth=%d, family=%d, size=%d, shape=%d, series=%d",\
700  RtfFontInfo[FontInfoDepth].series);
701 }
702 
703 void
705 {
706  if (FontInfoDepth == 0)
707  diagnostics(ERROR, "FontInfoDepth = 0, cannot PopFontSettings()!");
708 
709  FontInfoDepth--;
710  diagnostics(6,"PopFontSettings depth=%d, family=%d, size=%d, shape=%d, series=%d",\
713  RtfFontInfo[FontInfoDepth].series);
714 }
715 
716 void
718 {
719  int n;
720 
721  diagnostics(6, "\nMonitorFont %10s\n", text);
722  diagnostics(6,"MonitorFont before depth=%d, family=%d, size=%d, shape=%d, series=%d",\
725  RtfFontInfo[FontInfoDepth].series);
726 
727  if (strstart(text, "\\b0"))
729 
730  else if (strstart(text, "\\b ") || strstart(text, "\\b\\"))
732 
733  else if (strstart(text, "\\i0"))
735 
736  else if (strstart(text, "\\i ") || strstart(text, "\\i\\"))
738 
739  else if (strstart(text, "\\scaps0"))
741 
742  else if (strstart(text, "\\scaps ") || strstart(text, "\\scaps\\"))
744 
745  else if (strstartnum(text, "\\fs", &n))
747 
748  else if (strstartnum(text, "\\f", &n))
750 
751  else if (strstart(text, "\\plain")) {
756  }
757 
758  diagnostics(6,"MonitorFont after depth=%d, family=%d, size=%d, shape=%d, series=%d",\
761  RtfFontInfo[FontInfoDepth].series);
762 
763 }
#define text(a)
Definition: aptex-macros.h:925
ConfigEntryT ** CfgStartIterate(int WhichCfg)
Definition: cfg.c:361
int SearchRtfIndex(const char *theTexCommand, int WhichCfg)
Definition: cfg.c:329
ConfigEntryT ** CfgNext(int WhichCfg, ConfigEntryT **last)
Definition: cfg.c:370
#define FONT_A
Definition: cfg.h:2
#define n
Definition: t4ht.c:1290
@ FALSE
Definition: dd.h:101
@ TRUE
Definition: dd.h:102
#define free(a)
Definition: decNumber.cpp:310
int strcmp()
Definition: coll.cpp:143
#define s
Definition: afcover.h:80
string family
#define NULL
Definition: ftobjs.h:61
small capitals from c petite p scientific i
Definition: afcover.h:80
int num
Definition: disdvi.c:621
#define ERROR(string)
Definition: error.h:36
void ConvertString(char *string)
Definition: convert.c:103
void diagnostics(int level, char *format,...)
Definition: main.c:469
void fprintRTF(char *format,...)
Definition: main.c:722
int strncmp()
#define isdigit(c)
Definition: snprintf.c:177
void CmdUnderline(int code)
Definition: l2r_fonts.c:452
int CurrentCyrillicFontFamily(void)
Definition: l2r_fonts.c:619
static RtfFontInfoType RtfFontInfo[301]
Definition: l2r_fonts.c:99
void MonitorFontChanges(char *text)
Definition: l2r_fonts.c:717
#define MAX_FONT_INFO_DEPTH
Definition: l2r_fonts.c:98
void CmdFontSize(int code)
Definition: l2r_fonts.c:375
int CurrentFontShape(void)
Definition: l2r_fonts.c:655
struct RtfFontInfoType RtfFontInfoType
static bool strstart(char *text, char *str)
Definition: l2r_fonts.c:520
void PopFontSettings(void)
Definition: l2r_fonts.c:704
static bool strstartnum(char *text, char *str, int *num)
Definition: l2r_fonts.c:535
static int FontInfoDepth
Definition: l2r_fonts.c:100
int RtfFontNumber(char *Fname)
Definition: l2r_fonts.c:103
int DefaultFontFamily(void)
Definition: l2r_fonts.c:581
int CurrentFontSeries(void)
Definition: l2r_fonts.c:676
int DefaultFontSize(void)
Definition: l2r_fonts.c:588
void InitializeDocumentFont(int family, int size, int shape, int series)
Definition: l2r_fonts.c:560
void CmdFontSeries(int code)
Definition: l2r_fonts.c:309
void CmdTextNormal(int code)
Definition: l2r_fonts.c:469
int CurrentFontSize(void)
Definition: l2r_fonts.c:665
int TexFontNumber(char *Fname)
Definition: l2r_fonts.c:123
void PushFontSettings(void)
Definition: l2r_fonts.c:686
void CmdEmphasize(int code)
Definition: l2r_fonts.c:403
void CmdFontShape(int code)
Definition: l2r_fonts.c:233
int DefaultFontShape(void)
Definition: l2r_fonts.c:595
void CmdFontFamily(int code)
Definition: l2r_fonts.c:133
int DefaultFontSeries(void)
Definition: l2r_fonts.c:602
int CurrentFontFamily(void)
Definition: l2r_fonts.c:609
#define F_FAMILY_TYPEWRITER_4
Definition: l2r_fonts.h:17
#define F_SHAPE_CAPS_4
Definition: l2r_fonts.h:37
#define F_SHAPE_SLANTED_3
Definition: l2r_fonts.h:26
#define F_FAMILY_ROMAN_1
Definition: l2r_fonts.h:4
#define F_SERIES_MEDIUM
Definition: l2r_fonts.h:43
#define F_SMALLER
Definition: l2r_fonts.h:62
#define F_SERIES_MEDIUM_3
Definition: l2r_fonts.h:46
#define F_SERIES_BOLD
Definition: l2r_fonts.h:47
#define F_SHAPE_UPRIGHT_3
Definition: l2r_fonts.h:41
#define F_SERIES_MEDIUM_1
Definition: l2r_fonts.h:44
#define F_FAMILY_ROMAN_2
Definition: l2r_fonts.h:5
#define F_SHAPE_SLANTED_1
Definition: l2r_fonts.h:24
#define F_SHAPE_ITALIC
Definition: l2r_fonts.h:28
#define F_EMPHASIZE_2
Definition: l2r_fonts.h:59
#define F_SERIES_BOLD_4
Definition: l2r_fonts.h:51
#define F_FAMILY_SANSSERIF_4
Definition: l2r_fonts.h:12
#define F_TEXT_NORMAL_2
Definition: l2r_fonts.h:55
#define F_FAMILY_CALLIGRAPHIC_2
Definition: l2r_fonts.h:20
#define F_FAMILY_ROMAN
Definition: l2r_fonts.h:3
#define F_SHAPE_CAPS_3
Definition: l2r_fonts.h:36
#define F_FAMILY_TYPEWRITER
Definition: l2r_fonts.h:13
#define F_SHAPE_ITALIC_4
Definition: l2r_fonts.h:32
#define F_FAMILY_TYPEWRITER_1
Definition: l2r_fonts.h:14
#define F_FAMILY_SANSSERIF_1
Definition: l2r_fonts.h:9
#define F_FAMILY_SANSSERIF_3
Definition: l2r_fonts.h:11
#define F_FAMILY_CALLIGRAPHIC
Definition: l2r_fonts.h:18
#define F_FAMILY_CALLIGRAPHIC_3
Definition: l2r_fonts.h:21
#define F_SHAPE_UPRIGHT
Definition: l2r_fonts.h:38
#define F_FAMILY_ROMAN_3
Definition: l2r_fonts.h:6
#define F_SHAPE_ITALIC_2
Definition: l2r_fonts.h:30
#define F_SERIES_BOLD_1
Definition: l2r_fonts.h:48
#define F_FAMILY_TYPEWRITER_2
Definition: l2r_fonts.h:15
#define F_SHAPE_CAPS
Definition: l2r_fonts.h:33
#define F_SHAPE_CAPS_1
Definition: l2r_fonts.h:34
#define F_SHAPE_ITALIC_1
Definition: l2r_fonts.h:29
#define F_FAMILY_CALLIGRAPHIC_1
Definition: l2r_fonts.h:19
#define F_LARGER
Definition: l2r_fonts.h:63
#define F_FAMILY_ROMAN_4
Definition: l2r_fonts.h:7
#define F_SHAPE_UPRIGHT_2
Definition: l2r_fonts.h:40
#define F_TEXT_NORMAL_3
Definition: l2r_fonts.h:56
#define F_SHAPE_SLANTED
Definition: l2r_fonts.h:23
#define F_SHAPE_CAPS_2
Definition: l2r_fonts.h:35
#define F_SHAPE_SLANTED_2
Definition: l2r_fonts.h:25
#define F_EMPHASIZE_3
Definition: l2r_fonts.h:60
#define F_FAMILY_SANSSERIF
Definition: l2r_fonts.h:8
#define F_FAMILY_SANSSERIF_2
Definition: l2r_fonts.h:10
#define F_SHAPE_ITALIC_3
Definition: l2r_fonts.h:31
#define F_SERIES_BOLD_2
Definition: l2r_fonts.h:49
#define F_SERIES_BOLD_3
Definition: l2r_fonts.h:50
#define F_SHAPE_UPRIGHT_1
Definition: l2r_fonts.h:39
#define F_SERIES_MEDIUM_2
Definition: l2r_fonts.h:45
#define F_SHAPE_SLANTED_4
Definition: l2r_fonts.h:27
#define F_FAMILY_TYPEWRITER_3
Definition: l2r_fonts.h:16
char * getBraceParam(void)
static int size
Definition: ppmlabel.c:24
#define str(s)
Definition: sh6.c:399
Definition: inftrees.h:24
*job_name strlen((char *) job_name) - 4)
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)
#define font_type(a)
Definition: texfont.h:287
@ ON
Definition: ubidiimp.h:55