\hypertarget{unipagecount_8c_source}{}\doxysection{unipagecount.\+c}
\label{unipagecount_8c_source}\index{src/unipagecount.c@{src/unipagecount.c}}
\mbox{\hyperlink{unipagecount_8c}{Go to the documentation of this file.}}
\begin{DoxyCode}{0}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00001}00001 \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00002}00002 \textcolor{comment}{   @file unipagecount.c}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00003}00003 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00004}00004 \textcolor{comment}{   @brief unipagecount -\/ Count the number of glyphs defined in each page}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00005}00005 \textcolor{comment}{                         of 256 code points}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00006}00006 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00007}00007 \textcolor{comment}{   @author Paul Hardy, unifoundry <at> unifoundry.com, December 2007}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00008}00008 \textcolor{comment}{   }}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00009}00009 \textcolor{comment}{   @copyright Copyright (C) 2007, 2008, 2013, 2014 Paul Hardy}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00010}00010 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00011}00011 \textcolor{comment}{   This program counts the number of glyphs that are defined in each}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00012}00012 \textcolor{comment}{   "{}page"{} of 256 code points, and prints the counts in an 8 x 8 grid.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00013}00013 \textcolor{comment}{   Input is from stdin.  Output is to stdout.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00014}00014 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00015}00015 \textcolor{comment}{   The background color of each cell in a 16-\/by-\/16 grid of 256 code points}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00016}00016 \textcolor{comment}{   is shaded to indicate percentage coverage.  Red indicates 0\% coverage,}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00017}00017 \textcolor{comment}{   green represents 100\% coverage, and colors in between pure red and pure}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00018}00018 \textcolor{comment}{   green indicate partial coverage on a scale.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00019}00019 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00020}00020 \textcolor{comment}{   Each code point range number can be a hyperlink to a PNG file for}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00021}00021 \textcolor{comment}{   that 256-\/code point range's corresponding bitmap glyph image.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00022}00022 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00023}00023 \textcolor{comment}{   Synopsis:}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00024}00024 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00025}00025 \textcolor{comment}{             unipagecount < font\_file.hex > count.txt}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00026}00026 \textcolor{comment}{             unipagecount -\/phex\_page\_num < font\_file.hex  -\/-\/ just 256 points}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00027}00027 \textcolor{comment}{             unipagecount -\/h < font\_file.hex              -\/-\/ HTML table}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00028}00028 \textcolor{comment}{             unipagecount -\/P1 -\/h < font.hex > count.html  -\/-\/ Plane 1, HTML out}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00029}00029 \textcolor{comment}{             unipagecount -\/l < font\_file.hex              -\/-\/ linked HTML table}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00030}00030 \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00031}00031 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00032}00032 \textcolor{comment}{   LICENSE:}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00033}00033 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00034}00034 \textcolor{comment}{      This program is free software: you can redistribute it and/or modify}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00035}00035 \textcolor{comment}{      it under the terms of the GNU General Public License as published by}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00036}00036 \textcolor{comment}{      the Free Software Foundation, either version 2 of the License, or}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00037}00037 \textcolor{comment}{      (at your option) any later version.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00038}00038 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00039}00039 \textcolor{comment}{      This program is distributed in the hope that it will be useful,}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00040}00040 \textcolor{comment}{      but WITHOUT ANY WARRANTY; without even the implied warranty of}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00041}00041 \textcolor{comment}{      MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00042}00042 \textcolor{comment}{      GNU General Public License for more details.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00043}00043 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00044}00044 \textcolor{comment}{      You should have received a copy of the GNU General Public License}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00045}00045 \textcolor{comment}{      along with this program.  If not, see <http://www.gnu.org/licenses/>.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00046}00046 \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00047}00047 }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00048}00048 \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00049}00049 \textcolor{comment}{   2018, Paul Hardy: Changed "{}Private Use"{} to "{}Private Use Area"{} in}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00050}00050 \textcolor{comment}{   output HTML file.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00051}00051 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00052}00052 \textcolor{comment}{   21 October 2023 [Paul Hardy]:}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00053}00053 \textcolor{comment}{   -\/ Added full prototype for mkftable function in main function.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00054}00054 \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00055}00055 }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00056}00056 \textcolor{preprocessor}{\#include <stdio.h>}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00057}00057 \textcolor{preprocessor}{\#include <stdlib.h>}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00058}00058 }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00059}\mbox{\hyperlink{unipagecount_8c_ad7871643c05865c80f5d8050aead2b57}{00059}} \textcolor{preprocessor}{\#define MAXBUF 256 }\textcolor{comment}{///< Maximum input line size -\/ 1.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00060}00060 }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00061}00061 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00062}00062 \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00063}00063 \textcolor{comment}{   @brief The main function.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00064}00064 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00065}00065 \textcolor{comment}{   @param[in] argc The count of command line arguments.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00066}00066 \textcolor{comment}{   @param[in] argv Pointer to array of command line arguments.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00067}00067 \textcolor{comment}{   @return This program exits with status 0.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00068}00068 \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00069}00069 \textcolor{keywordtype}{int}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00070}\mbox{\hyperlink{unipagecount_8c_a0ddf1224851353fc92bfbff6f499fa97}{00070}} \mbox{\hyperlink{unipagecount_8c_a0ddf1224851353fc92bfbff6f499fa97}{main}} (\textcolor{keywordtype}{int} argc, \textcolor{keywordtype}{char} *argv[])}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00071}00071 \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00072}00072 }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00073}00073    \textcolor{keywordtype}{char} inbuf[\mbox{\hyperlink{unipagecount_8c_ad7871643c05865c80f5d8050aead2b57}{MAXBUF}}]; \textcolor{comment}{/* Max 256 characters in an input line */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00074}00074    \textcolor{keywordtype}{int} i, j;  \textcolor{comment}{/* loop variables */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00075}00075    \textcolor{keywordtype}{unsigned} plane=0; \textcolor{comment}{/* Unicode plane number, 0 to 0x16 */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00076}00076    \textcolor{keywordtype}{unsigned} page;  \textcolor{comment}{/* unicode page (256 bytes wide) */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00077}00077    \textcolor{keywordtype}{unsigned} unichar; \textcolor{comment}{/* unicode character */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00078}00078    \textcolor{keywordtype}{int} pagecount[256] = \{256 * 0\};}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00079}00079    \textcolor{keywordtype}{int} onepage=0; \textcolor{comment}{/* set to one if printing character grid for one page */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00080}00080    \textcolor{keywordtype}{int} pageno=0; \textcolor{comment}{/* page number selected if only examining one page */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00081}00081    \textcolor{keywordtype}{int} html=0;   \textcolor{comment}{/* =0: print plain text; =1: print HTML */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00082}00082    \textcolor{keywordtype}{int} links=0;  \textcolor{comment}{/* =1: print HTML links; =0: don't print links */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00083}00083 }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00084}00084    \textcolor{comment}{/* make (print) flipped HTML table */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00085}00085    \textcolor{keywordtype}{void} \mbox{\hyperlink{unipagecount_8c_ab3fa087c3244a7238a3109a42834608c}{mkftable}} (\textcolor{keywordtype}{unsigned} plane, \textcolor{keywordtype}{int} pagecount[256], \textcolor{keywordtype}{int} links);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00086}00086 }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00087}00087    \textcolor{keywordtype}{size\_t} strlen();}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00088}00088 }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00089}00089    \textcolor{keywordflow}{if} (argc > 1 \&\& argv[1][0] == \textcolor{charliteral}{'-\/'}) \{  \textcolor{comment}{/* Parse option */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00090}00090       plane = 0;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00091}00091       \textcolor{keywordflow}{for} (i = 1; i < argc; i++) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00092}00092          \textcolor{keywordflow}{switch} (argv[i][1]) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00093}00093             \textcolor{keywordflow}{case} \textcolor{charliteral}{'p'}:  \textcolor{comment}{/* specified -\/p<hexpage> -\/-\/ use given page number */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00094}00094                sscanf (\&argv[1][2], \textcolor{stringliteral}{"{}\%x"{}}, \&pageno);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00095}00095                \textcolor{keywordflow}{if} (pageno >= 0 \&\& pageno <= 255) onepage = 1;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00096}00096                \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00097}00097             \textcolor{keywordflow}{case} \textcolor{charliteral}{'h'}:  \textcolor{comment}{/* print HTML table instead of text table */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00098}00098                html = 1;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00099}00099                \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00100}00100             \textcolor{keywordflow}{case} \textcolor{charliteral}{'l'}:  \textcolor{comment}{/* print hyperlinks in HTML table */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00101}00101                links = 1;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00102}00102                html = 1;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00103}00103                \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00104}00104             \textcolor{keywordflow}{case} \textcolor{charliteral}{'P'}:  \textcolor{comment}{/* Plane number specified */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00105}00105                plane = atoi(\&argv[1][2]);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00106}00106                \textcolor{keywordflow}{break};}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00107}00107          \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00108}00108       \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00109}00109    \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00110}00110    \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00111}00111 \textcolor{comment}{      Initialize pagecount to account for noncharacters.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00112}00112 \textcolor{comment}{   */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00113}00113    \textcolor{keywordflow}{if} (!onepage \&\& plane==0) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00114}00114       pagecount[0xfd] = 32;  \textcolor{comment}{/* for U+FDD0..U+FDEF */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00115}00115    \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00116}00116    pagecount[0xff] = 2;   \textcolor{comment}{/* for U+nnFFFE, U+nnFFFF */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00117}00117    \textcolor{comment}{/*}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00118}00118 \textcolor{comment}{      Read one line at a time from input.  The format is:}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00119}00119 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00120}00120 \textcolor{comment}{         <hexpos>:<hexbitmap>}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00121}00121 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00122}00122 \textcolor{comment}{      where <hexpos> is the hexadecimal Unicode character position}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00123}00123 \textcolor{comment}{      in the range 00..FF and <hexbitmap> is the sequence of hexadecimal}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00124}00124 \textcolor{comment}{      digits of the character, laid out in a grid from left to right,}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00125}00125 \textcolor{comment}{      top to bottom.  The character is assumed to be 16 rows of variable}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00126}00126 \textcolor{comment}{      width.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00127}00127 \textcolor{comment}{   */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00128}00128    \textcolor{keywordflow}{while} (fgets (inbuf, \mbox{\hyperlink{unipagecount_8c_ad7871643c05865c80f5d8050aead2b57}{MAXBUF}}-\/1, stdin) != NULL) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00129}00129       sscanf (inbuf, \textcolor{stringliteral}{"{}\%X"{}}, \&unichar);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00130}00130       page = unichar >> 8;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00131}00131       \textcolor{keywordflow}{if} (onepage) \{ \textcolor{comment}{/* only increment counter if this is page we want */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00132}00132          \textcolor{keywordflow}{if} (page == pageno) \{ \textcolor{comment}{/* character is in the page we want */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00133}00133             pagecount[unichar \& 0xff]++; \textcolor{comment}{/* mark character as covered */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00134}00134          \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00135}00135       \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00136}00136       \textcolor{keywordflow}{else} \{ \textcolor{comment}{/* counting all characters in all pages */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00137}00137          \textcolor{keywordflow}{if} (plane == 0) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00138}00138             \textcolor{comment}{/* Don't add in noncharacters (U+FDD0..U+FDEF, U+FFFE, U+FFFF) */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00139}00139             \textcolor{keywordflow}{if} (unichar < 0xfdd0 || (unichar > 0xfdef \&\& unichar < 0xfffe))}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00140}00140                pagecount[page]++;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00141}00141          \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00142}00142          \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00143}00143             \textcolor{keywordflow}{if} ((page >> 8) == plane) \{ \textcolor{comment}{/* code point is in desired plane */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00144}00144                pagecount[page \& 0xFF]++;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00145}00145             \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00146}00146          \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00147}00147       \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00148}00148    \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00149}00149    \textcolor{keywordflow}{if} (html) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00150}00150       \mbox{\hyperlink{unipagecount_8c_ab3fa087c3244a7238a3109a42834608c}{mkftable}} (plane, pagecount, links);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00151}00151    \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00152}00152    \textcolor{keywordflow}{else} \{  \textcolor{comment}{/* Otherwise, print plain text table */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00153}00153       \textcolor{keywordflow}{if} (plane > 0) fprintf (stdout, \textcolor{stringliteral}{"{}  "{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00154}00154       fprintf (stdout,}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00155}00155          \textcolor{stringliteral}{"{}     0   1   2   3   4   5   6   7   8   9   A   B   C   D   E   F\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00156}00156       \textcolor{keywordflow}{for} (i=0; i<0x10; i++) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00157}00157          fprintf (stdout,\textcolor{stringliteral}{"{}\%02X\%X "{}}, plane, i); \textcolor{comment}{/* row header */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00158}00158          \textcolor{keywordflow}{for} (j=0; j<0x10; j++) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00159}00159             \textcolor{keywordflow}{if} (onepage) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00160}00160                \textcolor{keywordflow}{if} (pagecount[i*16+j])}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00161}00161                   fprintf (stdout,\textcolor{stringliteral}{"{} *  "{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00162}00162                \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00163}00163                   fprintf (stdout,\textcolor{stringliteral}{"{} .  "{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00164}00164             \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00165}00165             \textcolor{keywordflow}{else} \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00166}00166                fprintf (stdout, \textcolor{stringliteral}{"{}\%3X "{}}, pagecount[i*16+j]);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00167}00167             \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00168}00168          \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00169}00169          fprintf (stdout,\textcolor{stringliteral}{"{}\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00170}00170       \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00171}00171    }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00172}00172    \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00173}00173    exit (0);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00174}00174 \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00175}00175 }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00176}00176 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00177}00177 \textcolor{comment}{/**}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00178}00178 \textcolor{comment}{   @brief Create an HTML table linked to PNG images.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00179}00179 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00180}00180 \textcolor{comment}{   This function creates an HTML table to show PNG files}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00181}00181 \textcolor{comment}{   in a 16 by 16 grid.  The background color of each "{}page"{}}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00182}00182 \textcolor{comment}{   of 256 code points is shaded from red (for 0\% coverage)}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00183}00183 \textcolor{comment}{   to green (for 100\% coverage).}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00184}00184 \textcolor{comment}{}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00185}00185 \textcolor{comment}{   @param[in] plane The Unicode plane, 0..17.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00186}00186 \textcolor{comment}{   @param[in] pagecount Array with count of glyphs in each 256 code point range.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00187}00187 \textcolor{comment}{   @param[in] links 1 = generate hyperlinks, 0 = do not generate hyperlinks.}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00188}00188 \textcolor{comment}{*/}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00189}00189 \textcolor{keywordtype}{void}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00190}\mbox{\hyperlink{unipagecount_8c_ab3fa087c3244a7238a3109a42834608c}{00190}} \mbox{\hyperlink{unipagecount_8c_ab3fa087c3244a7238a3109a42834608c}{mkftable}} (\textcolor{keywordtype}{unsigned} plane, \textcolor{keywordtype}{int} pagecount[256], \textcolor{keywordtype}{int} links)}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00191}00191 \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00192}00192    \textcolor{keywordtype}{int} i, j;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00193}00193    \textcolor{keywordtype}{int} count;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00194}00194    \textcolor{keywordtype}{unsigned} bgcolor;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00195}00195    }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00196}00196    printf (\textcolor{stringliteral}{"{}<html>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00197}00197    printf (\textcolor{stringliteral}{"{}<body>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00198}00198    printf (\textcolor{stringliteral}{"{}<table border=\(\backslash\)"{}3\(\backslash\)"{} align=\(\backslash\)"{}center\(\backslash\)"{}>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00199}00199    printf (\textcolor{stringliteral}{"{}  <tr><th colspan=\(\backslash\)"{}16\(\backslash\)"{} bgcolor=\(\backslash\)"{}\#ffcc80\(\backslash\)"{}>"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00200}00200    printf (\textcolor{stringliteral}{"{}GNU Unifont Glyphs<br>with Page Coverage for Plane \%d<br>(Green=100\%\%, Red=0\%\%)</th></tr>\(\backslash\)n"{}}, plane);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00201}00201    \textcolor{keywordflow}{for} (i = 0x0; i <= 0xF; i++) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00202}00202       printf (\textcolor{stringliteral}{"{}  <tr>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00203}00203       \textcolor{keywordflow}{for} (j = 0x0; j <= 0xF; j++) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00204}00204          count = pagecount[ (i << 4) | j ];}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00205}00205          }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00206}00206          \textcolor{comment}{/* print link in cell if links == 1 */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00207}00207          \textcolor{keywordflow}{if} (plane != 0 || (i < 0xd || (i == 0xd \&\& j < 0x8) || (i == 0xf \&\& j > 0x8))) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00208}00208             \textcolor{comment}{/* background color is light green if completely done */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00209}00209             \textcolor{keywordflow}{if} (count == 0x100) bgcolor = 0xccffcc;}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00210}00210             \textcolor{comment}{/* otherwise background is a shade of yellow to orange to red */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00211}00211             \textcolor{keywordflow}{else} bgcolor = 0xff0000 | (count << 8) | (count >> 1);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00212}00212             printf (\textcolor{stringliteral}{"{}    <td bgcolor=\(\backslash\)"{}\#\%06X\(\backslash\)"{}>"{}}, bgcolor);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00213}00213             \textcolor{keywordflow}{if} (plane == 0)}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00214}00214                printf (\textcolor{stringliteral}{"{}<a href=\(\backslash\)"{}png/plane\%02X/uni\%02X\%X\%X.png\(\backslash\)"{}>\%X\%X</a>"{}}, plane, plane, i, j, i, j);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00215}00215             \textcolor{keywordflow}{else}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00216}00216                printf (\textcolor{stringliteral}{"{}<a href=\(\backslash\)"{}png/plane\%02X/uni\%02X\%X\%X.png\(\backslash\)"{}>\%02X\%X\%X</a>"{}}, plane, plane, i, j, plane, i, j);}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00217}00217             printf (\textcolor{stringliteral}{"{}</td>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00218}00218          \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00219}00219          \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (i == 0xd) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00220}00220             \textcolor{keywordflow}{if} (j == 0x8) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00221}00221                printf (\textcolor{stringliteral}{"{}    <td align=\(\backslash\)"{}center\(\backslash\)"{} colspan=\(\backslash\)"{}8\(\backslash\)"{} bgcolor=\(\backslash\)"{}\#cccccc\(\backslash\)"{}>"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00222}00222                printf (\textcolor{stringliteral}{"{}<b>Surrogate Pairs</b>"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00223}00223                printf (\textcolor{stringliteral}{"{}</td>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00224}00224             \}  \textcolor{comment}{/* otherwise don't print anything more columns in this row */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00225}00225          \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00226}00226          \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (i == 0xe) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00227}00227             \textcolor{keywordflow}{if} (j == 0x0) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00228}00228                printf (\textcolor{stringliteral}{"{}    <td align=\(\backslash\)"{}center\(\backslash\)"{} colspan=\(\backslash\)"{}16\(\backslash\)"{} bgcolor=\(\backslash\)"{}\#cccccc\(\backslash\)"{}>"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00229}00229                printf (\textcolor{stringliteral}{"{}<b>Private Use Area</b>"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00230}00230                printf (\textcolor{stringliteral}{"{}</td>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00231}00231             \}  \textcolor{comment}{/* otherwise don't print any more columns in this row */}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00232}00232          \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00233}00233          \textcolor{keywordflow}{else} \textcolor{keywordflow}{if} (i == 0xf) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00234}00234             \textcolor{keywordflow}{if} (j == 0x0) \{}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00235}00235                printf (\textcolor{stringliteral}{"{}    <td align=\(\backslash\)"{}center\(\backslash\)"{} colspan=\(\backslash\)"{}9\(\backslash\)"{} bgcolor=\(\backslash\)"{}\#cccccc\(\backslash\)"{}>"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00236}00236                printf (\textcolor{stringliteral}{"{}<b>Private Use Area</b>"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00237}00237                printf (\textcolor{stringliteral}{"{}</td>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00238}00238             \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00239}00239          \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00240}00240       \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00241}00241       printf (\textcolor{stringliteral}{"{}  </tr>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00242}00242    \}}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00243}00243    printf (\textcolor{stringliteral}{"{}</table>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00244}00244    printf (\textcolor{stringliteral}{"{}</body>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00245}00245    printf (\textcolor{stringliteral}{"{}</html>\(\backslash\)n"{}});}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00246}00246 }
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00247}00247    \textcolor{keywordflow}{return};}
\DoxyCodeLine{\Hypertarget{unipagecount_8c_source_l00248}00248 \}}

\end{DoxyCode}
