home *** CD-ROM | disk | FTP | other *** search
/ OS/2 Shareware BBS: 10 Tools / 10-Tools.zip / netpbma.zip / pbm / libpbm5.c < prev    next >
C/C++ Source or Header  |  1993-11-17  |  45KB  |  1,086 lines

  1. /* libpbm5.c - pbm utility library part 5
  2. **
  3. ** Font routines.
  4. **
  5. ** Support for BDF fonts Copyright 1993 by George Phillips.
  6. **
  7. ** Copyright (C) 1991 by Jef Poskanzer.
  8. **
  9. ** Permission to use, copy, modify, and distribute this software and its
  10. ** documentation for any purpose and without fee is hereby granted, provided
  11. ** that the above copyright notice appear in all copies and that both that
  12. ** copyright notice and this permission notice appear in supporting
  13. ** documentation.  This software is provided "as is" without express or
  14. ** implied warranty.
  15. */
  16.  
  17. #include "pbm.h"
  18. #include "pbmfont.h"
  19.  
  20. /* The default font, packed in hex so this source file doesn't get huge.
  21. ** You can replace this with your own font using pbm_dumpfont().
  22. */
  23. #define DEFAULTFONT_ROWS 155
  24. #define DEFAULTFONT_COLS 112
  25. static unsigned long defaultfont_bits[DEFAULTFONT_ROWS][(DEFAULTFONT_COLS+31)/32] = {
  26.     {0x00000000L,0x20000c00L,0x10000000L,0x00000000L},
  27.     {0xc600a000L,0x42000810L,0x00000002L,0x00000063L},
  28.     {0x6c00a000L,0x45000810L,0x00000002L,0x00000036L},
  29.     {0x6c00a000L,0x88800808L,0xf2e1dee2L,0x00000036L},
  30.     {0x54000000L,0x80000800L,0x11122442L,0x0000002aL},
  31.     {0x54000001L,0x00000800L,0x11122442L,0x0000002aL},
  32.     {0x54000001L,0x00000800L,0x11122282L,0x0000002aL},
  33.     {0x44000102L,0x00000800L,0x11122382L,0x00000022L},
  34.     {0xee000102L,0x00000800L,0x11e1e102L,0x00000077L},
  35.     {0x00000204L,0x00000800L,0x11002102L,0x00000000L},
  36.     {0x00000000L,0x00000c00L,0x11002102L,0x00000000L},
  37.     {0x00000000L,0x003f8000L,0xe3807600L,0x00000000L},
  38.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  39.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  40.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  41.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  42.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  43.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  44.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  45.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  46.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  47.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  48.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  49.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  50.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  51.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  52.     {0x02000080L,0x00040000L,0x00120000L,0x00000001L},
  53.     {0x04000082L,0x828e1838L,0x20210100L,0x00000002L},
  54.     {0x04000082L,0x82912448L,0x20210100L,0x00000002L},
  55.     {0x08000082L,0x8fd01940L,0x404087c2L,0x00000004L},
  56.     {0x08000080L,0x050c0622L,0x00408102L,0x00000004L},
  57.     {0x10000080L,0x05061874L,0x0040828fL,0x00008008L},
  58.     {0x10000080L,0x1f912688L,0x00408002L,0x00000008L},
  59.     {0x20000000L,0x0a11098cL,0x00408002L,0x00000010L},
  60.     {0x20000080L,0x0a0e0672L,0x00210000L,0x00000010L},
  61.     {0x40000000L,0x00040000L,0x00210000L,0x00000020L},
  62.     {0x00000000L,0x00000000L,0x00120000L,0x00000000L},
  63.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  64.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  65.     {0x00000000L,0x004e0838L,0x7023e1cfL,0x00008000L},
  66.     {0x00000000L,0x00913844L,0x88620208L,0x00008000L},
  67.     {0x08000000L,0x00910844L,0x08a20401L,0x00000004L},
  68.     {0x10000000L,0x01110844L,0x08a20401L,0x00000008L},
  69.     {0x20000000L,0x01110808L,0x3123c781L,0x00000010L},
  70.     {0x400003e0L,0x02110810L,0x0a202441L,0x00000020L},
  71.     {0x20000000L,0x02110820L,0x0bf02442L,0x00000010L},
  72.     {0x10008000L,0x04110844L,0x88242442L,0x00000008L},
  73.     {0x08008002L,0x040e3e7cL,0x7073c382L,0x00000004L},
  74.     {0x00010000L,0x08000000L,0x00000000L,0x00000000L},
  75.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  76.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  77.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  78.     {0x0000e1c0L,0x00000000L,0x00000000L,0x00000000L},
  79.     {0x00011220L,0x00000000L,0x70e38f87L,0x00000000L},
  80.     {0x20011220L,0x00020020L,0x89108448L,0x00008010L},
  81.     {0x10011220L,0x00040010L,0x09314448L,0x00008008L},
  82.     {0x0800e221L,0x02083e08L,0x11514788L,0x00000004L},
  83.     {0x040111e0L,0x00100004L,0x2153e448L,0x00000002L},
  84.     {0x08011020L,0x00083e08L,0x213a2448L,0x00008004L},
  85.     {0x10011040L,0x02040010L,0x01022448L,0x00008008L},
  86.     {0x2000e381L,0x02020020L,0x20e77f87L,0x00000010L},
  87.     {0x00000000L,0x04000000L,0x00000000L,0x00000000L},
  88.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  89.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  90.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  91.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  92.     {0x3803e7efL,0xc73bbe3dL,0xdb863ce7L,0x0000001cL},
  93.     {0x44011224L,0x48910808L,0x91036648L,0x00008022L},
  94.     {0x4c011285L,0x48910808L,0xa1036648L,0x00008026L},
  95.     {0x54011387L,0x081f0808L,0xc102a548L,0x0000802aL},
  96.     {0x54011285L,0x09910808L,0xe102a548L,0x0000802aL},
  97.     {0x4e011204L,0x08910848L,0x9112a4c8L,0x00008027L},
  98.     {0x40011224L,0x08910848L,0x891224c8L,0x00008020L},
  99.     {0x3803e7efL,0x073bbe31L,0xcff77e47L,0x0000001cL},
  100.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  101.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  102.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  103.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  104.     {0x00000000L,0x00000000L,0x00000003L,0x00000000L},
  105.     {0x0003e1cfL,0x87bff7efL,0xdfbf77c2L,0x00000000L},
  106.     {0x00013224L,0x48a4a244L,0x89122442L,0x00000000L},
  107.     {0x00011224L,0x4824a244L,0xa8a14482L,0x00000000L},
  108.     {0x00013227L,0x8e04226cL,0xa8414102L,0x00000000L},
  109.     {0x0001e224L,0x83842228L,0xa8a08102L,0x00000000L},
  110.     {0x00010224L,0x40842228L,0xd8a08242L,0x00000000L},
  111.     {0x00010224L,0x48843638L,0x51108442L,0x00000000L},
  112.     {0x0003c1ceL,0x6f1f1c10L,0x53b9c7c2L,0x00000000L},
  113.     {0x00000060L,0x00000000L,0x00000002L,0x00000000L},
  114.     {0x00000000L,0x00000000L,0x00000003L,0x00000000L},
  115.     {0xfe000000L,0x00000000L,0x00000000L,0x0000007fL},
  116.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  117.     {0x00010180L,0x000000c0L,0x003001c0L,0x00000000L},
  118.     {0x08008081L,0x00040040L,0x00100200L,0x00000004L},
  119.     {0x10008082L,0x80040040L,0x00100200L,0x00000008L},
  120.     {0x10004084L,0x40023c78L,0x70f1c7c7L,0x00004008L},
  121.     {0x10004080L,0x00000244L,0x89122208L,0x00008008L},
  122.     {0x20002080L,0x00001e44L,0x8113e208L,0x00008010L},
  123.     {0x10002080L,0x00002244L,0x81120208L,0x00008008L},
  124.     {0x10001080L,0x00002244L,0x89122208L,0x00008008L},
  125.     {0x10001080L,0x00001db8L,0x70e9c787L,0x00008008L},
  126.     {0x10000880L,0x00000000L,0x00000000L,0x00008008L},
  127.     {0x08000180L,0x00000000L,0x00000000L,0x00008004L},
  128.     {0x00000000L,0x1fc00000L,0x00000007L,0x00000000L},
  129.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  130.     {0x00030080L,0x981c0000L,0x00000000L,0x00000000L},
  131.     {0x20010000L,0x08040000L,0x00000000L,0x00000010L},
  132.     {0x10010000L,0x08040000L,0x00000000L,0x00000008L},
  133.     {0x10016387L,0x898474b8L,0x72e1d5c7L,0x00000008L},
  134.     {0x10019080L,0x8a042a64L,0x89122208L,0x00008008L},
  135.     {0x08011080L,0x8c042a44L,0x89122207L,0x00000004L},
  136.     {0x10011080L,0x8a042a44L,0x89122200L,0x00008008L},
  137.     {0x10011080L,0x89042a44L,0x89122208L,0x00008008L},
  138.     {0x1003bbe0L,0x98dfebe6L,0x71e1e787L,0x00000008L},
  139.     {0x10000000L,0x80000000L,0x01002000L,0x00000008L},
  140.     {0x20000000L,0x80000000L,0x01002000L,0x00000010L},
  141.     {0x00000007L,0x00000000L,0x03807000L,0x00000000L},
  142.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  143.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  144.     {0x00008000L,0x00000000L,0x10410000L,0x00000000L},
  145.     {0x00008000L,0x00000000L,0x20408000L,0x00000000L},
  146.     {0x0001f66eL,0xfdfbf77cL,0x20408000L,0x00000000L},
  147.     {0x24008224L,0x488a2248L,0x20408240L,0x00000012L},
  148.     {0x54008224L,0x4a842210L,0x40404540L,0x0000002aL},
  149.     {0x48008222L,0x8a8a1420L,0x20408480L,0x00000024L},
  150.     {0x00008a23L,0x85111c44L,0x20408000L,0x00000000L},
  151.     {0x000071d1L,0x0531887cL,0x20408000L,0x00000000L},
  152.     {0x00000000L,0x00000800L,0x20408000L,0x00000000L},
  153.     {0x00000000L,0x00000800L,0x10410000L,0x00000000L},
  154.     {0x00000000L,0x00003000L,0x00000000L,0x00000000L},
  155.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  156.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  157.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  158.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  159.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  160.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  161.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  162.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  163.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  164.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  165.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  166.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  167.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  168.     {0x00000000L,0x00000000L,0x00000000L,0x00000000L},
  169.     {0x00000000L,0x20000c00L,0x10000000L,0x00000000L},
  170.     {0xc600a000L,0x42000810L,0x00000002L,0x00000063L},
  171.     {0x6c00a000L,0x45000810L,0x00000002L,0x00000036L},
  172.     {0x6c00a000L,0x88800808L,0xf2e1dee2L,0x00000036L},
  173.     {0x54000000L,0x80000800L,0x11122442L,0x0000002aL},
  174.     {0x54000001L,0x00000800L,0x11122442L,0x0000002aL},
  175.     {0x54000001L,0x00000800L,0x11122282L,0x0000002aL},
  176.     {0x44000102L,0x00000800L,0x11122382L,0x00000022L},
  177.     {0xee000102L,0x00000800L,0x11e1e102L,0x00000077L},
  178.     {0x00000204L,0x00000800L,0x11002102L,0x00000000L},
  179.     {0x00000000L,0x00000c00L,0x11002102L,0x00000000L},
  180.     {0x00000000L,0x003f8000L,0xe3807600L,0x00000000L}
  181.     };
  182.  
  183. /* A default BDF font */
  184. /* Not as nicely compacted as the PBM font, oh well. */
  185.  
  186. static struct glyph _g[190] = {
  187.  { 1, 1, 0, 0, 3, "\0" },
  188.  { 1, 9, 1, 0, 3, "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\1\0\0\0\0\1\0\0\0\0\0\1\0\0\0\0\1\0\0\0\0\1\1\0\0\0\0" },
  375.  { 5, 12, 0, -3, 6, "\1\1\0\0\0\0\1\0\0\0\0\1\0\0\0\0\1\1\1\0\0\1\0\0\1\0\1\0\0\1\0\1\0\0\1\0\1\0\0\1\0\1\1\1\0\0\1\0\0\0\0\1\0\0\0\1\1\1\0\0" },
  376.  { 6, 11, 0, -3, 6, "\0\1\0\0\1\0\0\0\0\0\0\0\1\1\0\0\1\1\0\1\0\0\1\0\0\1\0\1\1\0\0\1\0\1\0\0\0\0\1\1\0\0\0\0\1\0\0\0\0\0\1\0\0\0\0\1\0\0\0\0\1\1\0\0\0\0" }
  377. };
  378.  
  379. static struct font default_bdffont = { 14, 15, -1, -3, {
  380.  0,
  381.  0,
  382.  0,
  383.  0,
  384.  0,
  385.  0,
  386.  0,
  387.  0,
  388.  0,
  389.  0,
  390.  0,
  391.  0,
  392.  0,
  393.  0,
  394.  0,
  395.  0,
  396.  0,
  397.  0,
  398.  0,
  399.  0,
  400.  0,
  401.  0,
  402.  0,
  403.  0,
  404.  0,
  405.  0,
  406.  0,
  407.  0,
  408.  0,
  409.  0,
  410.  0,
  411.  0,
  412.  _g + 0,
  413.  _g + 1,
  414.  _g + 2,
  415.  _g + 3,
  416.  _g + 4,
  417.  _g + 5,
  418.  _g + 6,
  419.  _g + 7,
  420.  _g + 8,
  421.  _g + 9,
  422.  _g + 10,
  423.  _g + 11,
  424.  _g + 12,
  425.  _g + 13,
  426.  _g + 14,
  427.  _g + 15,
  428.  _g + 16,
  429.  _g + 17,
  430.  _g + 18,
  431.  _g + 19,
  432.  _g + 20,
  433.  _g + 21,
  434.  _g + 22,
  435.  _g + 23,
  436.  _g + 24,
  437.  _g + 25,
  438.  _g + 26,
  439.  _g + 27,
  440.  _g + 28,
  441.  _g + 29,
  442.  _g + 30,
  443.  _g + 31,
  444.  _g + 32,
  445.  _g + 33,
  446.  _g + 34,
  447.  _g + 35,
  448.  _g + 36,
  449.  _g + 37,
  450.  _g + 38,
  451.  _g + 39,
  452.  _g + 40,
  453.  _g + 41,
  454.  _g + 42,
  455.  _g + 43,
  456.  _g + 44,
  457.  _g + 45,
  458.  _g + 46,
  459.  _g + 47,
  460.  _g + 48,
  461.  _g + 49,
  462.  _g + 50,
  463.  _g + 51,
  464.  _g + 52,
  465.  _g + 53,
  466.  _g + 54,
  467.  _g + 55,
  468.  _g + 56,
  469.  _g + 57,
  470.  _g + 58,
  471.  _g + 59,
  472.  _g + 60,
  473.  _g + 61,
  474.  _g + 62,
  475.  _g + 63,
  476.  _g + 64,
  477.  _g + 65,
  478.  _g + 66,
  479.  _g + 67,
  480.  _g + 68,
  481.  _g + 69,
  482.  _g + 70,
  483.  _g + 71,
  484.  _g + 72,
  485.  _g + 73,
  486.  _g + 74,
  487.  _g + 75,
  488.  _g + 76,
  489.  _g + 77,
  490.  _g + 78,
  491.  _g + 79,
  492.  _g + 80,
  493.  _g + 81,
  494.  _g + 82,
  495.  _g + 83,
  496.  _g + 84,
  497.  _g + 85,
  498.  _g + 86,
  499.  _g + 87,
  500.  _g + 88,
  501.  _g + 89,
  502.  _g + 90,
  503.  _g + 91,
  504.  _g + 92,
  505.  _g + 93,
  506.  _g + 94,
  507.  0,
  508.  0,
  509.  0,
  510.  0,
  511.  0,
  512.  0,
  513.  0,
  514.  0,
  515.  0,
  516.  0,
  517.  0,
  518.  0,
  519.  0,
  520.  0,
  521.  0,
  522.  0,
  523.  0,
  524.  0,
  525.  0,
  526.  0,
  527.  0,
  528.  0,
  529.  0,
  530.  0,
  531.  0,
  532.  0,
  533.  0,
  534.  0,
  535.  0,
  536.  0,
  537.  0,
  538.  0,
  539.  0,
  540.  0,
  541.  _g + 95,
  542.  _g + 96,
  543.  _g + 97,
  544.  _g + 98,
  545.  _g + 99,
  546.  _g + 100,
  547.  _g + 101,
  548.  _g + 102,
  549.  _g + 103,
  550.  _g + 104,
  551.  _g + 105,
  552.  _g + 106,
  553.  _g + 107,
  554.  _g + 108,
  555.  _g + 109,
  556.  _g + 110,
  557.  _g + 111,
  558.  _g + 112,
  559.  _g + 113,
  560.  _g + 114,
  561.  _g + 115,
  562.  _g + 116,
  563.  _g + 117,
  564.  _g + 118,
  565.  _g + 119,
  566.  _g + 120,
  567.  _g + 121,
  568.  _g + 122,
  569.  _g + 123,
  570.  _g + 124,
  571.  _g + 125,
  572.  _g + 126,
  573.  _g + 127,
  574.  _g + 128,
  575.  _g + 129,
  576.  _g + 130,
  577.  _g + 131,
  578.  _g + 132,
  579.  _g + 133,
  580.  _g + 134,
  581.  _g + 135,
  582.  _g + 136,
  583.  _g + 137,
  584.  _g + 138,
  585.  _g + 139,
  586.  _g + 140,
  587.  _g + 141,
  588.  _g + 142,
  589.  _g + 143,
  590.  _g + 144,
  591.  _g + 145,
  592.  _g + 146,
  593.  _g + 147,
  594.  _g + 148,
  595.  _g + 149,
  596.  _g + 150,
  597.  _g + 151,
  598.  _g + 152,
  599.  _g + 153,
  600.  _g + 154,
  601.  _g + 155,
  602.  _g + 156,
  603.  _g + 157,
  604.  _g + 158,
  605.  _g + 159,
  606.  _g + 160,
  607.  _g + 161,
  608.  _g + 162,
  609.  _g + 163,
  610.  _g + 164,
  611.  _g + 165,
  612.  _g + 166,
  613.  _g + 167,
  614.  _g + 168,
  615.  _g + 169,
  616.  _g + 170,
  617.  _g + 171,
  618.  _g + 172,
  619.  _g + 173,
  620.  _g + 174,
  621.  _g + 175,
  622.  _g + 176,
  623.  _g + 177,
  624.  _g + 178,
  625.  _g + 179,
  626.  _g + 180,
  627.  _g + 181,
  628.  _g + 182,
  629.  _g + 183,
  630.  _g + 184,
  631.  _g + 185,
  632.  _g + 186,
  633.  _g + 187,
  634.  _g + 188,
  635.  _g + 189
  636.  }
  637. };
  638.  
  639. struct font*
  640. pbm_defaultfont( name )
  641.     char* name;
  642.     {
  643.     bit** defaultfont;
  644.     int row, col, scol;
  645.     unsigned long l;
  646.  
  647.     if (!strcmp(name, "bdf"))
  648.     return &default_bdffont;
  649.  
  650.     if (strcmp(name, "fixed"))
  651.     pm_error( "built-in font name unknown, try 'bdf' or 'fixed'" );
  652.  
  653.     defaultfont = pbm_allocarray( DEFAULTFONT_COLS, DEFAULTFONT_ROWS );
  654.     for ( row = 0; row < DEFAULTFONT_ROWS; ++row )
  655.     {
  656.     for ( col = 0; col < DEFAULTFONT_COLS; col += 32 )
  657.         {
  658.         l = defaultfont_bits[row][col / 32];
  659.         for ( scol = min( col + 32, DEFAULTFONT_COLS ) - 1;
  660.           scol >= col; --scol )
  661.         {
  662.         if ( l & 1 )
  663.             defaultfont[row][scol] = 1;
  664.         else
  665.             defaultfont[row][scol] = 0;
  666.         l >>= 1;
  667.         }
  668.         }
  669.     }
  670.  
  671.     return pbm_dissectfont( defaultfont, DEFAULTFONT_ROWS, DEFAULTFONT_COLS );
  672.     }
  673.  
  674. struct font*
  675. pbm_dissectfont( font, frows, fcols )
  676.     bit** font;
  677.     int frows;
  678.     int fcols;
  679.     {
  680.     /*
  681.     ** This routine expects a font bitmap representing the following text:
  682.     **
  683.     ** (0,0)
  684.     **    M ",/^_[`jpqy| M
  685.     **
  686.     **    /  !"#$%&'()*+ /
  687.     **    < ,-./01234567 <
  688.     **    > 89:;<=>?@ABC >
  689.     **    @ DEFGHIJKLMNO @
  690.     **    _ PQRSTUVWXYZ[ _
  691.     **    { \]^_`abcdefg {
  692.     **    } hijklmnopqrs }
  693.     **    ~ tuvwxyz{|}~  ~
  694.     **
  695.     **    M ",/^_[`jpqy| M
  696.     **
  697.     ** The bitmap must be cropped exactly to the edges.
  698.     **
  699.     ** The dissection works by finding the first blank row and column; that
  700.     ** gives the height and width of the maximum-sized character, which is
  701.     ** not too useful.  But the distance from there to the opposite side is
  702.     ** an integral multiple of the cell size, and that's what we need.  Then
  703.     ** it's just a matter of filling in all the coordinates.
  704.     **
  705.     ** The difference between char_height, char_width and char_aheight,
  706.     ** char_awidth is that the first is the size of the cell including
  707.     ** spacing, while the second is just the actual maximum-size character.
  708.     */
  709.     int char_width, char_height, char_awidth, char_aheight;
  710.     int brow, bcol, row, col, d, ch, r, c, i;
  711.     struct font* fn;
  712.     struct glyph* glyph;
  713.     char* bmap;
  714.     bit b;
  715.  
  716.     /* Find first blank row. */
  717.     for ( brow = 0; brow < frows / 6; ++brow )
  718.     {
  719.     b = font[brow][0];
  720.     for ( col = 1; col < fcols; ++col )
  721.         if ( font[brow][col] != b )
  722.         goto nextrow;
  723.     goto gotblankrow;
  724.     nextrow: ;
  725.     }
  726.     pm_error( "couldn't find blank row in font" );
  727.  
  728. gotblankrow:
  729.     /* Find first blank col. */
  730.     for ( bcol = 0; bcol < fcols / 8; ++bcol )
  731.     {
  732.     b = font[0][bcol];
  733.     for ( row = 1; row < frows; ++row )
  734.         if ( font[row][bcol] != b )
  735.         goto nextcol;
  736.     goto gotblankcol;
  737.     nextcol: ;
  738.     }
  739.     pm_error( "couldn't find blank col in font" );
  740.  
  741. gotblankcol:
  742.     /* Now compute character cell size. */
  743.     d = frows - brow;
  744.     char_height = d / 11;
  745.     if ( char_height * 11 != d )
  746.     pm_error( "problem computing character cell height" );
  747.     d = fcols - bcol;
  748.     char_width = d / 15;
  749.     if ( char_width * 15 != d )
  750.     pm_error( "problem computing character cell width" );
  751.     char_aheight = brow;
  752.     char_awidth = bcol;
  753.  
  754.     /* Now convert to a general font */
  755.  
  756.     fn = (struct font*) malloc( sizeof(struct font) );
  757.     if ( fn == (struct font*) 0 )
  758.     pm_error( "out of memory allocating font structure" );
  759.  
  760.     fn->maxwidth = char_awidth;
  761.     fn->maxheight = char_height;
  762.     fn->x = fn->y = 0;
  763.     for (i = 0; i < 256; i++)
  764.     fn->glyph[i] = 0;
  765.     fn->oldfont = font;
  766.     fn->frows = frows;
  767.     fn->fcols = fcols;
  768.     
  769.     glyph = (struct glyph*) malloc( sizeof(struct glyph) * 95 );
  770.     if ( glyph == (struct glyph*) 0 )
  771.     pm_error( "out of memory allocating glyphs" );
  772.     
  773.     bmap = (char*) malloc( fn->maxwidth * fn->maxheight * 95 );
  774.     if ( bmap == (char*) 0)
  775.     pm_error( "out of memory allocating glyph data" );
  776.  
  777.     /* Now fill in the 0,0 coords. */
  778.     row = char_height * 2;
  779.     col = char_width * 2;
  780.     for ( ch = 0; ch < 95; ++ch )
  781.     {
  782.     glyph[ch].width = fn->maxwidth;
  783.     glyph[ch].height = fn->maxheight;
  784.     glyph[ch].x = glyph[ch].y = 0;
  785.     glyph[ch].xadd = char_width;
  786.  
  787.     for ( r = 0; r < glyph[ch].height; ++r )
  788.         for ( c = 0; c < glyph[ch].width; ++c )
  789.         bmap[r * glyph[ch].width + c] = font[row + r][col + c];
  790.     
  791.     glyph[ch].bmap = bmap;
  792.     bmap += glyph[ch].width * glyph[ch].height;
  793.  
  794.     fn->glyph[ch + 32] = glyph + ch;
  795.  
  796.     col += char_width;
  797.     if ( col >= char_width * 14 )
  798.         {
  799.         col = char_width * 2;
  800.         row += char_height;
  801.         }
  802.     }
  803.     
  804.     return fn;
  805.     }
  806.  
  807. struct font*
  808. pbm_loadfont( filename )
  809. char* filename;
  810. {
  811.     FILE* fp;
  812.     struct font* fn;
  813.     char line[256];
  814.  
  815.     fp = pm_openr( filename );
  816.     fgets(line, 256, fp);
  817.     pm_close( fp );
  818.  
  819.     if (line[0] == PBM_MAGIC1 && 
  820.     (line[1] == PBM_MAGIC2 || line[1] == RPBM_MAGIC2))
  821.     {
  822.     return pbm_loadpbmfont( filename );
  823.     }
  824.     else if (!strncmp(line, "STARTFONT", 9)) {
  825.     if (!(fn = pbm_loadbdffont( filename )))
  826.         pm_error( "could not load BDF font file" );
  827.     return fn;
  828.     }
  829.     else
  830.     pm_error( "font file not in a recognized format ");
  831. }
  832.  
  833. struct font* pbm_loadpbmfont( filename )
  834. char* filename;
  835. {
  836.     FILE* ifp;
  837.     bit** font;
  838.     int fcols, frows;
  839.  
  840.     ifp = pm_openr( filename );
  841.     font = pbm_readpbm( ifp, &fcols, &frows );
  842.     pm_close( ifp );
  843.     return pbm_dissectfont( font, frows, fcols );
  844. }
  845.  
  846. void
  847. pbm_dumpfont( fn )
  848.     struct font* fn;
  849. {
  850.     /* Dump out font as C source code. */
  851.     int row, col, scol, lperrow;
  852.     unsigned long l;
  853.  
  854.     if (fn->oldfont) {
  855.     printf( "#define DEFAULTFONT_ROWS %d\n", fn->frows );
  856.     printf( "#define DEFAULTFONT_COLS %d\n", fn->fcols );
  857.     printf( "static unsigned long defaultfont_bits[DEFAULTFONT_ROWS][(DEFAULTFONT_COLS+31)/32] = {\n" );
  858.     for ( row = 0; row < fn->frows; ++row )
  859.         {
  860.         lperrow = 0;
  861.         for ( col = 0; col < fn->fcols; col += 32 )
  862.         {
  863.         if ( lperrow == 0 )
  864.             printf( "    {" );
  865.         else if ( lperrow % 6 == 0 )
  866.             {
  867.             printf( ",\n     " );
  868.             lperrow = 0;
  869.             }
  870.         else
  871.             printf( "," );
  872.         l = 0;
  873.         for ( scol = col; scol < min( col + 32, fn->fcols ); ++scol )
  874.             {
  875.             l <<= 1;
  876.             if ( fn->oldfont[row][scol] )
  877.             l |= 1;
  878.             }
  879.         printf( "0x%08lxL", l );
  880.         ++lperrow;
  881.         }
  882.         printf( "}%s\n", row == fn->frows - 1 ? "" : "," );
  883.         }
  884.     printf( "    };\n" );
  885.     }
  886.     else {
  887.     struct glyph* glyph;
  888.     int i, j, ng;
  889.  
  890.     ng = 0;
  891.     for (i = 0; i < 256; i++)
  892.         if (fn->glyph[i])
  893.             ng++;
  894.  
  895.     printf("static struct glyph _g[%d] = {\n", ng);
  896.     for (i = 0; i < 256; i++) {
  897.         if (!(glyph = fn->glyph[i]))
  898.             continue;
  899.  
  900.         printf(" { %d, %d, %d, %d, %d, \"", glyph->width, glyph->height,
  901.             glyph->x, glyph->y, glyph->xadd);
  902.  
  903.         for (j = 0; j < glyph->width * glyph->height; j++)
  904.             if (glyph->bmap[j])
  905.                 printf("\\1");
  906.             else
  907.                 printf("\\0");
  908.         
  909.         ng--;
  910.         printf("\" }%s\n", ng ? "," : "");
  911.     }
  912.     printf("};\n");
  913.  
  914.     printf("static struct font default_bdffont = { %d, %d, %d, %d, {\n",
  915.         fn->maxwidth, fn->maxheight, fn->x, fn->y);
  916.  
  917.     for (i = 0; i < 256; i++) {
  918.         if (fn->glyph[i])
  919.             printf(" _g + %d", ng++);
  920.         else
  921.             printf(" 0");
  922.         
  923.         if (i != 255) printf(",");
  924.         printf("\n");
  925.     }
  926.  
  927.     printf(" }\n};\n");
  928.     exit(0);
  929.  
  930.     }
  931.  
  932. }
  933.  
  934.  
  935. /* Routines for loading a BDF font file */
  936.  
  937. static int readline ARGS((FILE* fp, char* buf, char* arg[]));
  938.  
  939. #define expect(str) if (readline(fp, line, arg) < 0 || strcmp(arg[0], (str))) \
  940.     { fclose(fp); return 0; }
  941.  
  942. struct font* pbm_loadbdffont(name)
  943. char* name;
  944. {
  945.     FILE* fp;
  946.     char line[1024], *arg[32], *b, *hex;
  947.     int i, n, numchar, hdig, encoding;
  948.     struct font* font;
  949.     struct glyph* glyph;
  950.  
  951.     if (!(fp = fopen(name, "r")))
  952.         return 0;
  953.  
  954.     expect("STARTFONT");
  955.  
  956.     if (!(font = (struct font*)malloc(sizeof(struct font))))
  957.         pm_error("no memory for font");
  958.     font->oldfont = 0;
  959.     for (i = 0; i < 256; i++)
  960.         font->glyph[i] = 0;
  961.  
  962.     while (readline(fp, line, arg) >= 0) {
  963.         if (!strcmp(arg[0], "COMMENT"))
  964.             continue;
  965.         if (!strcmp(arg[0], "SIZE"))
  966.             continue;
  967.         
  968.         if (!strcmp(arg[0], "STARTPROPERTIES")) {
  969.             n = atoi(arg[1]);
  970.             for (; n > 0 && readline(fp, line, arg) >= 0; n--)
  971.                 ;
  972.         }
  973.         else if (!strcmp(arg[0], "FONTBOUNDINGBOX")) {
  974.             font->maxwidth = atoi(arg[1]);
  975.             font->maxheight = atoi(arg[2]);
  976.             font->x = atoi(arg[3]);
  977.             font->y = atoi(arg[4]);
  978.         }
  979.         else if (!strcmp(arg[0], "ENDFONT")) {
  980.             fclose(fp);
  981.             return font;
  982.         }
  983.         else if (!strcmp(arg[0], "CHARS")) {
  984.             numchar = atoi(arg[1]);
  985.             while (numchar > 0) {
  986.                 if (readline(fp, line, arg) < 0) { fclose(fp); return 0; }
  987.                 if (!strcmp(arg[0], "COMMENT"))
  988.                     continue;
  989.                 if (strcmp(arg[0], "STARTCHAR")) { fclose(fp); return 0; }
  990.                 if (!(glyph = (struct glyph*)malloc(sizeof(struct glyph))))
  991.                     pm_error("no memory for font glyph");
  992.  
  993.                 expect("ENCODING");
  994.                 if ((encoding = atoi(arg[1])) < 0) {
  995.                     if (arg[2])
  996.                         encoding = atoi(arg[2]);
  997.                     else {
  998.                         while (readline(fp, line, arg) >= 0)
  999.                             if (!strcmp(arg[0], "ENDCHAR"))
  1000.                                 break;
  1001.                         
  1002.                         numchar--;
  1003.                         continue;
  1004.                     }
  1005.                 }
  1006.                 expect("SWIDTH");
  1007.                 expect("DWIDTH");
  1008.                 glyph->xadd = atoi(arg[1]);
  1009.                 expect("BBX");
  1010.                 glyph->width = atoi(arg[1]);
  1011.                 glyph->height = atoi(arg[2]);
  1012.                 glyph->x = atoi(arg[3]);
  1013.                 glyph->y = atoi(arg[4]);
  1014.  
  1015.                 if (!(glyph->bmap = (char*)malloc(glyph->width * glyph->height)))
  1016.                     pm_error("no memory for font glyph byte map");
  1017.  
  1018.                 if (readline(fp, line, arg) < 0) { fclose(fp); return 0; }
  1019.                 if (!strcmp(arg[0], "ATTRIBUTES"))
  1020.                     if (readline(fp, line, arg) < 0) { fclose(fp); return 0; }
  1021.                 
  1022.                 b = glyph->bmap;
  1023.                 for (n = glyph->height; n > 0; n--) {
  1024.                     if (readline(fp, line, arg) < 0) { fclose(fp); return 0; }
  1025.                     hex = line;
  1026.                     for (i = glyph->width; i > 0; i -= 4) {
  1027.                         hdig = *hex++;
  1028.                         if (hdig >= '0' && hdig <= '9')
  1029.                             hdig -= '0';
  1030.                         else if (hdig >= 'a' && hdig <= 'f')
  1031.                             hdig -= 'a' - 10;
  1032.                         else if (hdig >= 'A' && hdig <= 'F')
  1033.                             hdig -= 'A' - 10;
  1034.                         
  1035.                         *b++ = hdig & 8 ? 1 : 0;
  1036.                         if (i > 1) *b++ = hdig & 4 ? 1 : 0;
  1037.                         if (i > 2) *b++ = hdig & 2 ? 1 : 0;
  1038.                         if (i > 3) *b++ = hdig & 1;
  1039.                     }
  1040.                 }
  1041.  
  1042.                 expect("ENDCHAR");
  1043.  
  1044.                 font->glyph[encoding] = glyph;
  1045.  
  1046.                 numchar--;
  1047.             }
  1048.         }
  1049.     }
  1050.     return font;
  1051. }
  1052.  
  1053. static int readline(fp, buf, arg)
  1054. FILE* fp;
  1055. char* buf;
  1056. char* arg[];
  1057. {
  1058.     if (!fgets(buf, 1024, fp))
  1059.         return -1;
  1060.     
  1061.     return mk_argvn(buf, arg, 32);
  1062. }
  1063.  
  1064. int mk_argvn(s, vec, mk_max)
  1065. char* s;
  1066. char* vec[];
  1067. int mk_max;
  1068. {
  1069.     int    n;
  1070.  
  1071.     n = 0;
  1072.     while (*s) {
  1073.         if (isspace(*s)) {
  1074.             *s++ = '\0';
  1075.             continue;
  1076.         }
  1077.         vec[n++] = s;
  1078.         if (n >= mk_max)
  1079.             break;
  1080.         while (*s && !isspace(*s))
  1081.             s++;
  1082.     }
  1083.     vec[n] = 0;
  1084.     return n;
  1085. }
  1086.