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)  

pkout.c File Reference
#include "basics.h"
#include <stdio.h>
#include <stdarg.h>
#include <stdlib.h>
#include "pkout.h"
Include dependency graph for pkout.c:

Go to the source code of this file.


#define PK_ID   89
#define PK_SPC1   240 /* All we need, max length always < 255 */
#define PK_NUMSPC   244
#define PK_NOOP   246
#define PK_PRE   247
#define PK_POST   245
#define DPI   72.27
#define MIN(a, b)   ( (a<b)? (a): (b))
#define MAX_TWOBYTE_NYBBLE   (208 - 15*dyn_f)


void pk_open (char *pkname)
void pk_close (void)
static void pk1 (int)
static void pk_nybble (int x)
static void pk2 (int x)
static void pk3 (int32_t x)
static void pk4 (int32_t x)
void pk_preamble (char *comment, float pointsize, int32_t checksum, unsigned int h_res, unsigned int v_res)
static int optimal_size (int W, int H, int cnt, int count[], int *dyn_f)
static void pk_runlengths (int W, int H, int(*next_pixel)())
static void pk_number (int x)
static void pk_bitmap (int width, int cnt, int runlength[])
void pk_char (int char_code, int32_t tfm_width, int h_escapement, unsigned int width, unsigned int height, int h_offset, int v_offset, int(*next_pixel)())
static void pkstring (const char *fmt,...)
static int PSPKINT (float x)
static char * magnification (int dpi, int BDPI)
void pk_postamble (void)
void ps2pk_postamble (char *fontname, char *encname, int base_res, int h_res, int v_res, float pointsize, char *args)


static int pk_len = 0
static FILEpkfile
static int pk_output_byte
static int bitweight
static int MAX_COUNTS
static intcount = NULL
static int dyn_f
static int comp_size
static int cnt
static char mag_str [64]

Macro Definition Documentation


#define DPI   72.27

Definition at line 21 of file pkout.c.


#define MAX_TWOBYTE_NYBBLE   (208 - 15*dyn_f)

Definition at line 311 of file pkout.c.


#define MIN (   a,
)    ( (a<b)? (a): (b))

Definition at line 22 of file pkout.c.


#define PK_ID   89

Definition at line 14 of file pkout.c.


#define PK_NOOP   246

Definition at line 17 of file pkout.c.


#define PK_NUMSPC   244

Definition at line 16 of file pkout.c.


#define PK_POST   245

Definition at line 19 of file pkout.c.


#define PK_PRE   247

Definition at line 18 of file pkout.c.


#define PK_SPC1   240 /* All we need, max length always < 255 */

Definition at line 15 of file pkout.c.

Function Documentation

◆ magnification()

static char* magnification ( int  dpi,
int  BDPI 

Definition at line 504 of file pkout.c.

References dpi, fatal, mag_str, magstep(), PSPKINT(), size, and sprintf.

Referenced by ps2pk_postamble().

◆ optimal_size()

static int optimal_size ( int  W,
int  H,
int  cnt,
int  count[],
int dyn_f 

Definition at line 121 of file pkout.c.

References cnt, comp_size, count, dyn_f, H, i, j, k, and W.

Referenced by pk_runlengths().

◆ pk1()

static void pk1 ( int  x)

Definition at line 61 of file pkout.c.

References pk_len, pkfile, putc, and cordic::x.

Referenced by pk2(), pk3(), pk4(), pk_bitmap(), pk_char(), pk_nybble(), pk_postamble(), pk_preamble(), pkstring(), and ps2pk_postamble().

◆ pk2()

static void pk2 ( int  x)

Definition at line 68 of file pkout.c.

References pk1(), and cordic::x.

Referenced by pk_char(), and pxl_define().

◆ pk3()

static void pk3 ( int32_t  x)

Definition at line 75 of file pkout.c.

References pk1(), and cordic::x.

Referenced by pk_char(), and pxl_define().

◆ pk4()

static void pk4 ( int32_t  x)

Definition at line 82 of file pkout.c.

References pk1(), and cordic::x.

Referenced by pk_preamble(), and ps2pk_postamble().

◆ pk_bitmap()

static void pk_bitmap ( int  width,
int  cnt,
int  runlength[] 

Definition at line 338 of file pkout.c.

References buff, count, i, pk1(), power, rc, state, and width.

Referenced by pk_char().

◆ pk_char()

void pk_char ( int  char_code,
int32_t  tfm_width,
int  h_escapement,
unsigned int  width,
unsigned int  height,
int  h_offset,
int  v_offset,
int(*)()  next_pixel 

◆ pk_close()

void pk_close ( void  )

Definition at line 40 of file pkout.c.

References fclose, and pkfile.

Referenced by main().

◆ pk_number()

static void pk_number ( int  x)

Definition at line 313 of file pkout.c.

References dyn_f, k, MAX_TWOBYTE_NYBBLE, pk_nybble(), and cordic::x.

Referenced by pk_char().

◆ pk_nybble()

static void pk_nybble ( int  x)

Definition at line 51 of file pkout.c.

References bitweight, pk1(), pk_output_byte, and cordic::x.

Referenced by pk_number().

◆ pk_open()

void pk_open ( char *  pkname)

Definition at line 34 of file pkout.c.

References fatal, fopen, NULL, pkfile, pkname, and WB.

Referenced by main().

◆ pk_postamble()

void pk_postamble ( void  )

Definition at line 542 of file pkout.c.

References pk1(), pk_len, PK_NOOP, and PK_POST.

Referenced by main().

◆ pk_preamble()

void pk_preamble ( char *  comment,
float  pointsize,
int32_t  checksum,
unsigned int  h_res,
unsigned int  v_res 

Definition at line 96 of file pkout.c.

References checksum, comment, DPI, i, len, MAX_COUNTS, pk1(), pk4(), PK_ID, PK_PRE, pointsize, and strlen().

Referenced by main().

◆ pk_runlengths()

static void pk_runlengths ( int  W,
int  H,
int(*)()  next_pixel 

Definition at line 168 of file pkout.c.

References BLACK, cnt, col, comp_size, count, dyn_f, fatal, first_count, free, H, i, j, malloc, MAX_COUNTS, MIN, NULL, optimal_size(), OTHER, printf(), rc, row, W, and WHITE.

Referenced by pk_char().

◆ pkstring()

static void pkstring ( const char *  fmt,

Definition at line 475 of file pkout.c.

References args, buf, fatal, fmt, i, len, pk1(), PK_SPC1, strlen(), va_end, va_start, and void.

Referenced by ps2pk_postamble().

◆ ps2pk_postamble()

void ps2pk_postamble ( char *  fontname,
char *  encname,
int  base_res,
int  h_res,
int  v_res,
float  pointsize,
char *  args 

Definition at line 552 of file pkout.c.

References fontname, i, magnification(), pk1(), pk4(), pk_len, PK_NOOP, PK_NUMSPC, PK_POST, pkstring(), and pointsize.

Referenced by main().


static int PSPKINT ( float  x)

Definition at line 498 of file pkout.c.

References cordic::x.

Referenced by magnification().

Variable Documentation

◆ bitweight

int bitweight

Definition at line 48 of file pkout.c.

Referenced by pk_char(), and pk_nybble().

◆ cnt

int cnt

Definition at line 166 of file pkout.c.

Referenced by __gmpf_eq(), __gmpf_get_d_2exp(), __gmpf_pow_ui(), __gmpf_set_str(), __gmpn_div_q(), __gmpn_div_qr_1(), __gmpn_divrem_1(), __gmpn_gcd(), __gmpn_get_str(), __gmpn_lshift(), __gmpn_lshiftc(), __gmpn_mod_1_1p(), __gmpn_mod_1_1p_cps(), __gmpn_mod_1s_2p(), __gmpn_mod_1s_2p_cps(), __gmpn_mod_1s_3p(), __gmpn_mod_1s_3p_cps(), __gmpn_mod_1s_4p(), __gmpn_mod_1s_4p_cps(), __gmpn_perfect_square_p(), __gmpn_pow_1(), __gmpn_powlo(), __gmpn_powm(), __gmpn_rshift(), __gmpn_scan0(), __gmpn_scan1(), __gmpn_strongfibo(), __gmpn_tdiv_qr(), __gmpz_cdiv_q_2exp(), __gmpz_cdiv_r_2exp(), __gmpz_cfdiv_q_2exp(), __gmpz_cfdiv_r_2exp(), __gmpz_fdiv_q_2exp(), __gmpz_fdiv_r_2exp(), __gmpz_mul_2exp(), __gmpz_n_pow_ui(), __gmpz_powm(), __gmpz_scan0(), __gmpz_scan1(), __gmpz_tdiv_q_2exp(), __gmpz_tdiv_r_2exp(), _ApproximateSplineFromPoints(), _cairo_rtree_evict_random(), _Gen816Enc(), _glx_dummy_window(), _InterpretPS(), _SFReinstanciateRefs(), _SplineSetApprox(), _ttfapprox(), aat_dumpbsln(), aat_dumpfeat(), aat_dumpprop(), ClipperLib::PolyNode::AddChild(), AddEdge(), AddGhostSegment(), AddHintSet(), addinfo(), AddLineSegment(), AddMask2(), AddNewAALTFeatures(), AllGlyphNames(), AllNamelistNames(), amscheck(), AnchorClassDecompose(), ApplyTickedFeatures(), ApproxBounds(), ApproximateSplineFromPoints(), ApproximateSplineFromPointsSlopes(), ArrayCount(), double_conversion::Bignum::AssignHexString(), AssignPtNumbers(), build_equiv_class(), BuildFondList(), ClipperLib::Clipper::BuildResult(), ClipperLib::Clipper::BuildResult2(), calledit(), catch_handler_find(), CharsNotInEncoding(), CheckForNewlines(), CID2ChrsSubrs2(), CntRulesStartingWith(), CntRulesStartingWithClass(), CoincidentIntersect(), compute_subr_bias(), ContourPtNumMatch(), CountKerns(), CubicsIntersect(), curveto2(), CvtFindDeltas(), dclist_insert(), DevTabLen(), div1(), div2(), dodata(), dummywidthsfromstrike(), dump_append_queue(), dumpcffcidhmtx(), dumpcffencoding(), dumpcfffdselect(), dumpcffhmtx(), dumpg___ContextChainClass(), dumpg___ContextChainGlyphs(), dumpg___info(), dumpgposAnchorData(), dumpgposCursiveAttach(), dumpgposdevicetable(), dumpGPOSpairpos(), dumpGPOSsimplepos(), dumpGSUBligdata(), dumpGSUBmultiplesubs(), dumpGSUBsimplesubs(), DumpHints(), dumpinstrs(), DumpKernClass(), DumpLigCarets(), DumpRefsHints(), EntryExitDecompose(), extract_double(), FcDirCacheBasenameMD5(), fea_AddGlyphs(), fea_canonicalClassSet(), fea_glyphs_to_names(), fea_LookupTypeFromItem(), fea_markedglyphs_to_fpst(), fea_NameLookups(), fea_ParseGlyphClass(), fea_ParseSubstitute(), fea_ParseTableKeywords(), featuresAssignFlagsChains(), featuresOrderByType(), FigureInitialClasses(), FigureStems(), FindAllLangEntries(), FindHStems(), FindMatchingEdge(), FindNeeded(), FindOrderedEndpoints(), FindSubs(), FindVStems(), ClipperLib::Clipper::FixupIntersectionOrder(), FLOrder(), fmtstr(), FPSTGlyphToClass(), FT_Raccess_Get_DataOffsets(), g___ChainingSubTable1(), g___ChainingSubTable2(), g___ContextSubTable1(), g___ContextSubTable2(), g___FigureExtensionSubTables(), generateMapList(), get_image(), getAppleClassTable(), getClassDefTable(), getCoverageTable(), gethexints(), FormFieldChoice::getNumSelected(), OlsonTimeZone::getTimeZoneRules(), GICImportBlues(), GICImportStems(), glorpline(), GlyphDataInit(), GlyphsFromClasses(), GlyphsFromInitialClasses(), gposCursiveSubTable(), gposKernSubTable(), gposSimplePos(), GradImproveInter(), gsubLigatureSubTable(), gsubMultipleSubTable(), gsubSimpleSubTable(), gv_len(), has_valid_dstem(), highest_bit_idx(), HintMaskTransform(), i915_bo_exec(), ICAddInter(), ICBinarySearch(), InActive(), InitDict(), InitDStemData(), instr_typify(), IsCorrectSide(), IsLinearApprox(), IsResourceFork(), IsResourceForkFile(), IsResourceInHex(), IterateSplineSolve(), jbg_dec_in(), jstf_dumpmaxlookups(), jstf_SplitTables(), KCFindName(), KCSfree(), KernClassToSC(), kpathsea_getlongpath(), lc(), LigatureSearch(), LigCaretCnt(), LineFitsHV(), lineto2(), LineType(), Load_Simple_Glyph(), load_too_high(), luatex_calledit(), LUAUI_choose(), LUAUI_choose_multiple(), main(), MakeVirtualLine(), MarkClassFree(), MarkGlyphsProcessMarks(), MarkSetFree(), MatchWinding(), memrcpy(), MergeSegments(), MergeSegmentsFinal(), MonoGoesSomewhereUseful(), MonotonicFindAlong(), MonotonicFindAt(), MonotonicFindStemBounds(), MonotonicOrder(), mort_classes(), mpfr_add_ui(), mpfr_frac(), mpfr_mul_ui(), mpfr_nbits_ulong(), mpfr_set_f(), mpfr_set_si_2exp(), mpfr_set_ui_2exp(), mpfr_sqrt_ui(), mpfr_sub1sp(), mpfr_sub1sp1(), MPFR_Sub1sp1_mpfr_sub1sp1(), MPFR_Sub1sp1_mpfr_sub1sp1_gt_branch_1(), mpfr_sub1sp1n(), mpfr_sub1sp2(), mpfr_sub1sp2n(), mpfr_sub1sp3(), mpfr_sub_ui(), mpfr_ui_div(), mpfr_ui_sub(), mpfr_urandom(), mpfr_urandomb(), mpn_common_scan(), mpn_div_qr_1u_pi2(), mpn_lshift(), mpn_mod_1_unnorm(), mpn_mod_1s_4p_cps(), mpn_pow_1_highpart(), mpn_rshift(), mpz_bdiv_bin_uiui(), mpz_cdiv_q_2exp(), mpz_cdiv_r_2exp(), mpz_fdiv_q_2exp(), mpz_fdiv_r_2exp(), mpz_smallk_bin_uiui(), mpz_tdiv_q_2exp(), mpz_tdiv_r_2exp(), NameOTLookup(), NamesReadTTF(), NamesToGlyphs(), NClipboard_AddDataType(), NeedsUCS2Table(), NeedsVariationSequenceTable(), NewAALTLookup(), NormalizeT(), NOUI_choose(), NOUI_choose_multiple(), NowakowskiSCAutoInstr(), NumberHints(), optimal_size(), OrderedInitialGlyphs(), otf_dumpbase(), otf_dumpgdef(), otf_dumpjstf(), otv_MathItalicsCorrectionInfo_validate(), otv_MathKern_validate(), otv_MathKernInfo_validate(), parseline(), ParseSaveTablesPref(), PfEd_Colours(), PfEd_GlyphComments(), pfed_guide_sortuniq(), PfEd_Layer(), PfEd_Layers(), PickCFFFont(), PickFOND(), PickTTFFont(), pk_char(), pk_runlengths(), ClipperLib::PointInPolygon(), printf(), PSCharStringToBB(), PSCharStringToSplines(), pushio(), putbits(), putmbi(), randseed_mt(), readcffenc(), readcfffontnames(), readcffset(), JBIG2Stream::readSymbolDictSeg(), readttfcopyrights(), readttfencodings(), readttffeatures(), readttfgasp(), readttfgdef(), readttflookups(), readttfmaxp(), readttfscripts(), readttfsimpleglyph(), ReadType(), RefLayerFindBaseLayerIndex(), RulesCopy(), SCFindDeltas(), SCGuessHintInstancesList(), SCOrderAP(), SCReinstanciateRefChar(), SFD_GetFont(), SFDGetPrivate(), SFDGetSubrs(), SFDParseChainContext(), SFDParseJustify(), SFDUnPickle(), SFFeaturesInScriptLang(), SFFigureDefWidth(), SFFindBiggestScriptLangIndex(), SFGlyphsFromNames(), SFGlyphsWithLigatureinLookup(), SFGlyphsWithPSTinSubtable(), SFJstfSort(), SFLangsInScript(), SFLookupsInScriptLangFeature(), SFMatchGlyphs(), SFOrderedGlyphs(), SFScriptsInLookups(), SFStandardHeight(), SigmaDeltas(), skipglyphs(), SllkMatch(), SLOrder(), sorttaglist(), Spline2DFindPointsOfInflection(), SplineFont2ChrsSubrs2(), SplinePointListIsClockwise(), SplinesFigureTPsBetween(), SplinesIntersect(), SplineSolveForPen(), SSRemoveUTurns(), SSToMContour(), StemFitsHV(), StillStem(), strcache_print_stats(), subroutineBias(), sum_raw(), T1Read(), TestForBadDirections(), ttc_dump(), ttc_perfonttables(), ttc_prep(), ttf_bdf_read(), ttf_dumpcvar(), ttf_math_dump_mathglyphconstructiontable(), ttf_math_read_icta(), ttf_math_read_mathkern(), ttf_math_read_mathkernv(), ttfApprox(), UnblendedCompare(), unicode_init_user(), VI_DisplayWindow(), VI_FindCharacter(), and WriteTTC().

◆ comp_size

int comp_size

Definition at line 166 of file pkout.c.

Referenced by optimal_size(), pk_char(), and pk_runlengths().

◆ count

int* count = NULL

Definition at line 163 of file pkout.c.

Referenced by optimal_size(), pk_bitmap(), pk_char(), and pk_runlengths().

◆ dyn_f

int dyn_f

Definition at line 166 of file pkout.c.

Referenced by optimal_size(), pk_char(), pk_number(), and pk_runlengths().

◆ mag_str

char mag_str[64]

Definition at line 502 of file pkout.c.

Referenced by magnification().



Definition at line 94 of file pkout.c.

Referenced by pk_preamble(), and pk_runlengths().

◆ pk_len

int pk_len = 0

Definition at line 31 of file pkout.c.

Referenced by pk1(), pk_postamble(), and ps2pk_postamble().

◆ pk_output_byte

int pk_output_byte

Definition at line 48 of file pkout.c.

Referenced by pk_char(), and pk_nybble().

◆ pkfile

FILE* pkfile

Definition at line 32 of file pkout.c.

Referenced by pk1(), pk_close(), and pk_open().