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 File Reference
#include <stdlib.h>
#include <string.h>
#include <ctype.h>
#include "main.h"
#include "convert.h"
#include "l2r_fonts.h"
#include "funct1.h"
#include "commands.h"
#include "cfg.h"
#include "parser.h"
#include "stack.h"
Include dependency graph for l2r_fonts.c:

Go to the source code of this file.

Classes

struct  RtfFontInfoType
 

Macros

#define MAX_FONT_INFO_DEPTH   301
 

Typedefs

typedef struct RtfFontInfoType RtfFontInfoType
 

Functions

int RtfFontNumber (char *Fname)
 
int TexFontNumber (char *Fname)
 
void CmdFontFamily (int code)
 
void CmdFontShape (int code)
 
void CmdFontSeries (int code)
 
void CmdFontSize (int code)
 
void CmdEmphasize (int code)
 
void CmdUnderline (int code)
 
void CmdTextNormal (int code)
 
static bool strstart (char *text, char *str)
 
static bool strstartnum (char *text, char *str, int *num)
 
void InitializeDocumentFont (int family, int size, int shape, int series)
 
int DefaultFontFamily (void)
 
int DefaultFontSize (void)
 
int DefaultFontShape (void)
 
int DefaultFontSeries (void)
 
int CurrentFontFamily (void)
 
int CurrentCyrillicFontFamily (void)
 
int CurrentFontShape (void)
 
int CurrentFontSize (void)
 
int CurrentFontSeries (void)
 
void PushFontSettings (void)
 
void PopFontSettings (void)
 
void MonitorFontChanges (char *text)
 

Variables

static RtfFontInfoType RtfFontInfo [301]
 
static int FontInfoDepth =0
 

Macro Definition Documentation

◆ MAX_FONT_INFO_DEPTH

#define MAX_FONT_INFO_DEPTH   301

Definition at line 98 of file l2r_fonts.c.

Typedef Documentation

◆ RtfFontInfoType

Function Documentation

◆ CmdEmphasize()

void CmdEmphasize ( int  code)

purpose: LaTeX commands , \emph, and \begin{em} ... \end{em}

      the \emph{string} construction is handled by \textit{string} or \textup{string}

      {\em string} should be properly localized by brace mechanisms

      \begin{em} ... \end{em} will be localized by environment mechanisms

F_EMPHASIZE_1        for  \em ... 
F_EMPHASIZE_2        for  \emph{...}
F_EMPHASIZE_3        for  \begin{em} ... \end{em}

Definition at line 403 of file l2r_fonts.c.

References CmdFontShape(), CurrentFontShape(), diagnostics(), F_EMPHASIZE_2, F_EMPHASIZE_3, F_SHAPE_ITALIC_2, F_SHAPE_UPRIGHT, F_SHAPE_UPRIGHT_2, family, FontInfoDepth, fprintRTF(), ON, RtfFontInfo, and size.

◆ CmdFontFamily()

◆ CmdFontSeries()

void CmdFontSeries ( int  code)

purpose : sets the font weight to medium or bold

F_SERIES_BOLD for \bfseries ... F_SERIES_BOLD_1 for \bf ... F_SERIES_BOLD_2 for \textbf{...} F_SERIES_BOLD_3 for \begin{bfseries} ... \end{bfseries}

Definition at line 309 of file l2r_fonts.c.

References ConvertString(), diagnostics(), F_SERIES_BOLD, F_SERIES_BOLD_1, F_SERIES_BOLD_2, F_SERIES_BOLD_3, F_SERIES_BOLD_4, F_SERIES_MEDIUM, F_SERIES_MEDIUM_1, F_SERIES_MEDIUM_2, F_SERIES_MEDIUM_3, family, FontInfoDepth, fprintRTF(), free, getBraceParam(), ON, RtfFontInfo, s, and size.

Referenced by CmdTextNormal().

◆ CmdFontShape()

void CmdFontShape ( int  code)

purpose : sets the font to upright, italic, or small caps F_SHAPE_ITALIC for \itshape F_SHAPE_ITALIC_1 for \it F_SHAPE_ITALIC_2 for \textit{...} F_SHAPE_ITALIC_3 for \begin{itshape} F_SHAPE_ITALIC_4 for \begin{it}

Definition at line 233 of file l2r_fonts.c.

References ConvertString(), diagnostics(), F_SHAPE_CAPS, F_SHAPE_CAPS_1, F_SHAPE_CAPS_2, F_SHAPE_CAPS_3, F_SHAPE_CAPS_4, F_SHAPE_ITALIC, F_SHAPE_ITALIC_1, F_SHAPE_ITALIC_2, F_SHAPE_ITALIC_3, F_SHAPE_ITALIC_4, F_SHAPE_SLANTED, F_SHAPE_SLANTED_1, F_SHAPE_SLANTED_2, F_SHAPE_SLANTED_3, F_SHAPE_SLANTED_4, F_SHAPE_UPRIGHT, F_SHAPE_UPRIGHT_1, F_SHAPE_UPRIGHT_2, F_SHAPE_UPRIGHT_3, family, FontInfoDepth, fprintRTF(), free, getBraceParam(), ON, RtfFontInfo, s, and size.

Referenced by CmdEmphasize(), and CmdTextNormal().

◆ CmdFontSize()

void CmdFontSize ( int  code)

purpose : handles LaTeX commands that change the font size

Definition at line 375 of file l2r_fonts.c.

References CurrentFontSize(), DefaultFontSize(), diagnostics(), F_LARGER, F_SMALLER, family, FontInfoDepth, fprintRTF(), int(), RtfFontInfo, and size.

Referenced by CmdTextNormal().

◆ CmdTextNormal()

void CmdTextNormal ( int  code)

purpose: handle \textnormal{text} {\normalfont ...} commands

F_TEXT_NORMAL        for  \normalfont ... 
F_TEXT_NORMAL_1
F_TEXT_NORMAL_2      for  \textnormal{...}
F_TEXT_NORMAL_3      for  \begin{normalfont} ... \end{normalfont}

Definition at line 469 of file l2r_fonts.c.

References CmdFontFamily(), CmdFontSeries(), CmdFontShape(), CmdFontSize(), ConvertString(), CurrentFontFamily(), CurrentFontSeries(), CurrentFontShape(), CurrentFontSize(), DefaultFontFamily(), DefaultFontSeries(), DefaultFontShape(), DefaultFontSize(), diagnostics(), F_TEXT_NORMAL_2, F_TEXT_NORMAL_3, family, FontInfoDepth, fprintRTF(), free, getBraceParam(), ON, RtfFontInfo, s, and size.

◆ CmdUnderline()

void CmdUnderline ( int  code)

purpose: handle \underline{text}

Definition at line 452 of file l2r_fonts.c.

References ConvertString(), diagnostics(), fprintRTF(), free, getBraceParam(), and s.

◆ CurrentCyrillicFontFamily()

int CurrentCyrillicFontFamily ( void  )

purpose: returns the cyrillic font that should be used ... if the current font is cyrillic font then -1 is returned

Definition at line 619 of file l2r_fonts.c.

References CfgNext(), CfgStartIterate(), CurrentFontFamily(), diagnostics(), FONT_A, font_type, i, num, strcmp(), strncmp(), and TexFontNumber().

◆ CurrentFontFamily()

int CurrentFontFamily ( void  )

purpose: returns the current RTF family

Definition at line 609 of file l2r_fonts.c.

References diagnostics(), RtfFontInfoType::family, family, FontInfoDepth, and RtfFontInfo.

Referenced by CmdTextNormal(), and CurrentCyrillicFontFamily().

◆ CurrentFontSeries()

int CurrentFontSeries ( void  )

purpose: returns the current RTF series

Definition at line 676 of file l2r_fonts.c.

References diagnostics(), FontInfoDepth, RtfFontInfo, and RtfFontInfoType::series.

Referenced by CmdTextNormal().

◆ CurrentFontShape()

int CurrentFontShape ( void  )

purpose: returns the current RTF shape

Definition at line 655 of file l2r_fonts.c.

References diagnostics(), FontInfoDepth, RtfFontInfo, and RtfFontInfoType::shape.

Referenced by CmdEmphasize(), and CmdTextNormal().

◆ CurrentFontSize()

◆ DefaultFontFamily()

int DefaultFontFamily ( void  )

◆ DefaultFontSeries()

int DefaultFontSeries ( void  )

Definition at line 602 of file l2r_fonts.c.

References diagnostics(), RtfFontInfo, and RtfFontInfoType::series.

Referenced by CmdTextNormal().

◆ DefaultFontShape()

int DefaultFontShape ( void  )

Definition at line 595 of file l2r_fonts.c.

References diagnostics(), RtfFontInfo, and RtfFontInfoType::shape.

Referenced by CmdTextNormal().

◆ DefaultFontSize()

int DefaultFontSize ( void  )

Definition at line 588 of file l2r_fonts.c.

References diagnostics(), RtfFontInfo, size, and RtfFontInfoType::size.

Referenced by CmdFontSize(), CmdTextNormal(), and setThree().

◆ InitializeDocumentFont()

void InitializeDocumentFont ( int  family,
int  size,
int  shape,
int  series 
)

purpose: Initialize the basic font properties for a document pass -1 to avoid setting any parameter

Definition at line 560 of file l2r_fonts.c.

References diagnostics(), RtfFontInfoType::family, family, RtfFontInfo, RtfFontInfoType::series, RtfFontInfoType::shape, size, and RtfFontInfoType::size.

Referenced by main(), setPackageFont(), and setPointSize().

◆ MonitorFontChanges()

◆ PopFontSettings()

void PopFontSettings ( void  )

Definition at line 704 of file l2r_fonts.c.

References diagnostics(), ERROR, family, FontInfoDepth, RtfFontInfo, and size.

Referenced by fprintRTF().

◆ PushFontSettings()

◆ RtfFontNumber()

◆ strstart()

static bool strstart ( char *  text,
char *  str 
)
static

Definition at line 520 of file l2r_fonts.c.

References FALSE, str, and TRUE.

Referenced by compare_info(), longest_match(), MonitorFontChanges(), storepacket(), and strstartnum().

◆ strstartnum()

static bool strstartnum ( char *  text,
char *  str,
int num 
)
static

Definition at line 535 of file l2r_fonts.c.

References FALSE, isdigit, num, str, strlen(), strstart(), text, and TRUE.

Referenced by MonitorFontChanges().

◆ TexFontNumber()

int TexFontNumber ( char *  Fname)

purpose: returns the RTF font number for a particular LaTeX font example: TexFontNumber("Roman")

Definition at line 123 of file l2r_fonts.c.

References FONT_A, and SearchRtfIndex().

Referenced by CmdFontFamily(), CmdTabular(), CmdVerb(), CmdVerbatim(), CurrentCyrillicFontFamily(), Ignore_Environment(), main(), RtfFontNumber(), and RtfHeader().

Variable Documentation

◆ FontInfoDepth

◆ RtfFontInfo