mk_fonts_alias.c 34 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345
  1. /*
  2. * CDE - Common Desktop Environment
  3. *
  4. * (c) Copyright 1993-2012 The Open Group
  5. * (c) Copyright 2012-2022 CDE Project contributors, see
  6. * CONTRIBUTORS for details
  7. *
  8. * These libraries and programs are free software; you can
  9. * redistribute them and/or modify them under the terms of the GNU
  10. * Lesser General Public License as published by the Free Software
  11. * Foundation; either version 2 of the License, or (at your option)
  12. * any later version.
  13. *
  14. * These libraries and programs are distributed in the hope that
  15. * they will be useful, but WITHOUT ANY WARRANTY; without even the
  16. * implied warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR
  17. * PURPOSE. See the GNU Lesser General Public License for more
  18. * details.
  19. *
  20. * You should have received a copy of the GNU Lesser General Public
  21. * License along with these libraries and programs; if not, write
  22. * to the Free Software Foundation, Inc., 51 Franklin Street, Fifth
  23. * Floor, Boston, MA 02110-1301 USA
  24. */
  25. #include <stdbool.h>
  26. #include <stdio.h>
  27. #include <string.h>
  28. #define IFACE_FAL_SIZE 7
  29. #define APP_FAL_SIZE 12
  30. struct xlfd_t {
  31. char *fndry;
  32. char *fmly;
  33. char *wght;
  34. char *slant;
  35. char *swdth;
  36. char *adstyl;
  37. char *pxlsz;
  38. char *ptsz;
  39. char *resx;
  40. char *resy;
  41. char *spc;
  42. char *avgwdth;
  43. char *rgstry;
  44. char *encdng;
  45. };
  46. struct font_alias_t {
  47. struct xlfd_t *font, *alias;
  48. };
  49. struct xlfd_t iface_font_xxs;
  50. struct xlfd_t iface_font_xs;
  51. struct xlfd_t iface_font_s;
  52. struct xlfd_t iface_font_m;
  53. struct xlfd_t iface_font_l;
  54. struct xlfd_t iface_font_xl;
  55. struct xlfd_t iface_font_xxl;
  56. struct xlfd_t iface_alias_xxs;
  57. struct xlfd_t iface_alias_xs;
  58. struct xlfd_t iface_alias_s;
  59. struct xlfd_t iface_alias_m;
  60. struct xlfd_t iface_alias_l;
  61. struct xlfd_t iface_alias_xl;
  62. struct xlfd_t iface_alias_xxl;
  63. struct font_alias_t iface_fal[IFACE_FAL_SIZE] = {
  64. {&iface_font_xxs, &iface_alias_xxs},
  65. {&iface_font_xs, &iface_alias_xs},
  66. {&iface_font_s, &iface_alias_s},
  67. {&iface_font_m, &iface_alias_m},
  68. {&iface_font_l, &iface_alias_l},
  69. {&iface_font_xl, &iface_alias_xl},
  70. {&iface_font_xxl, &iface_alias_xxl}
  71. };
  72. enum app_adstyl_spc_t {SANS_P, SERIF_M, SERIF_P};
  73. struct xlfd_t app_font[APP_FAL_SIZE], app_alias[APP_FAL_SIZE];
  74. struct font_alias_t app_fal[APP_FAL_SIZE];
  75. static void print_xlfd(struct xlfd_t *pxlfd) {
  76. fprintf(stdout, "\"-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s-%s\"",
  77. pxlfd->fndry,
  78. pxlfd->fmly,
  79. pxlfd->wght,
  80. pxlfd->slant,
  81. pxlfd->swdth,
  82. pxlfd->adstyl,
  83. pxlfd->pxlsz,
  84. pxlfd->ptsz,
  85. pxlfd->resx,
  86. pxlfd->resy,
  87. pxlfd->spc,
  88. pxlfd->avgwdth,
  89. pxlfd->rgstry,
  90. pxlfd->encdng);
  91. }
  92. static void print_font_alias(struct font_alias_t *pfa) {
  93. print_xlfd(pfa->alias); fprintf(stdout, " ");
  94. print_xlfd(pfa->font); fprintf(stdout, "\n");
  95. }
  96. static void iface_iso8859(bool is_user, bool is_bold) {
  97. for (int i = 0; i < IFACE_FAL_SIZE; ++i) {
  98. struct font_alias_t *pfa = &iface_fal[i];
  99. memset(pfa->font, 0, sizeof(struct xlfd_t));
  100. memset(pfa->alias, 0, sizeof(struct xlfd_t));
  101. pfa->font->fndry = "misc";
  102. pfa->font->fmly = "fixed";
  103. pfa->font->wght = "medium";
  104. pfa->font->slant = "r";
  105. pfa->font->swdth = "normal";
  106. pfa->font->adstyl = "";
  107. pfa->font->resx =
  108. pfa->font->resy = "75";
  109. pfa->font->spc = "c";
  110. pfa->font->rgstry = "iso8859";
  111. pfa->alias->fndry = "dt";
  112. pfa->alias->fmly = is_user ? "interface user" : "interface system";
  113. pfa->alias->wght = is_bold ? "bold" : "medium";
  114. pfa->alias->spc = "m";
  115. }
  116. if (is_bold) {
  117. iface_font_s.wght =
  118. iface_font_m.wght =
  119. iface_font_l.wght =
  120. iface_font_xl.wght = "bold";
  121. }
  122. iface_alias_xxs.adstyl = "xxs sans";
  123. iface_alias_xs.adstyl = "xs sans";
  124. iface_alias_s.adstyl = "s sans";
  125. iface_alias_m.adstyl = "m sans";
  126. iface_alias_l.adstyl = "l sans";
  127. iface_alias_xl.adstyl = "xl sans";
  128. iface_alias_xxl.adstyl = "xxl sans";
  129. iface_font_xxs.pxlsz = "9";
  130. iface_font_xxs.ptsz = "90";
  131. iface_font_xxs.avgwdth = "60";
  132. iface_font_xs.pxlsz = "10";
  133. iface_font_xs.ptsz = "100";
  134. iface_font_xs.avgwdth = "60";
  135. iface_font_s.pxlsz = "13";
  136. iface_font_s.ptsz = "120";
  137. iface_font_s.avgwdth = "70";
  138. iface_font_m.pxlsz = "14";
  139. iface_font_m.ptsz = "130";
  140. iface_font_m.avgwdth = "70";
  141. iface_font_l.pxlsz = "15";
  142. iface_font_l.ptsz = "140";
  143. iface_font_l.avgwdth = "90";
  144. iface_font_xl.pxlsz = "18";
  145. iface_font_xl.ptsz = "120";
  146. iface_font_xl.resx = "100";
  147. iface_font_xl.resy = "100";
  148. iface_font_xl.avgwdth = "90";
  149. iface_font_xxl.pxlsz = "20";
  150. iface_font_xxl.ptsz = "200";
  151. iface_font_xxl.avgwdth = "100";
  152. for (int i = 0; i < IFACE_FAL_SIZE; ++i) {
  153. struct font_alias_t *pfa = &iface_fal[i];
  154. pfa->alias->slant = pfa->font->slant;
  155. pfa->alias->swdth = pfa->font->swdth;
  156. pfa->alias->pxlsz = pfa->font->pxlsz;
  157. pfa->alias->ptsz = pfa->font->ptsz;
  158. pfa->alias->resx = pfa->font->resx;
  159. pfa->alias->resy = pfa->font->resy;
  160. pfa->alias->avgwdth = pfa->font->avgwdth;
  161. pfa->alias->rgstry = pfa->font->rgstry;
  162. }
  163. }
  164. static void iface_iso8859_11(bool is_user, bool is_bold) {
  165. iface_iso8859(is_user, is_bold);
  166. iface_font_xxs.pxlsz =
  167. iface_font_xs.pxlsz = iface_font_s.pxlsz;
  168. iface_font_xxs.ptsz =
  169. iface_font_xs.ptsz = iface_font_s.ptsz;
  170. iface_font_xxs.avgwdth =
  171. iface_font_xs.avgwdth = iface_font_s.avgwdth;
  172. iface_font_xl.wght = "medium";
  173. }
  174. static void iface_koi8_r(bool is_user, bool is_bold) {
  175. iface_iso8859(is_user, is_bold);
  176. for (int i = 0; i < IFACE_FAL_SIZE; ++i) {
  177. struct font_alias_t *pfa = &iface_fal[i];
  178. pfa->font->wght = "medium";
  179. pfa->font->rgstry = "koi8";
  180. pfa->font->encdng = "r";
  181. pfa->alias->rgstry = pfa->font->rgstry;
  182. pfa->alias->encdng = pfa->font->encdng;
  183. }
  184. }
  185. static void iface_jisx0201_1976_0(bool is_user, bool is_bold) {
  186. iface_iso8859(is_user, is_bold);
  187. for (int i = 0; i < IFACE_FAL_SIZE; ++i) {
  188. struct font_alias_t *pfa = &iface_fal[i];
  189. pfa->font->wght = "medium";
  190. pfa->font->pxlsz = "14";
  191. pfa->font->ptsz = "130";
  192. pfa->font->resx =
  193. pfa->font->resy = "75";
  194. pfa->font->avgwdth = "70";
  195. pfa->font->rgstry = "jisx0201.1976";
  196. pfa->font->encdng = "0";
  197. pfa->alias->pxlsz = pfa->font->pxlsz;
  198. pfa->alias->ptsz = pfa->font->ptsz;
  199. pfa->alias->resx = pfa->font->resx;
  200. pfa->alias->resy = pfa->font->resy;
  201. pfa->alias->avgwdth = pfa->font->avgwdth;
  202. pfa->alias->rgstry = pfa->font->rgstry;
  203. pfa->alias->encdng = pfa->font->encdng;
  204. }
  205. }
  206. static void iface_jisx0208_1983_0(bool is_user, bool is_bold) {
  207. iface_jisx0201_1976_0(is_user, is_bold);
  208. for (int i = 0; i < IFACE_FAL_SIZE; ++i) {
  209. struct font_alias_t *pfa = &iface_fal[i];
  210. pfa->font->fndry = "jis";
  211. pfa->font->pxlsz = "16";
  212. pfa->font->ptsz = "150";
  213. pfa->font->avgwdth = "160";
  214. pfa->font->rgstry = "jisx0208.1983";
  215. pfa->alias->rgstry = pfa->font->rgstry;
  216. }
  217. iface_font_xxs.fndry =
  218. iface_font_xs.fndry =
  219. iface_font_s.fndry = "misc";
  220. iface_font_xxs.pxlsz =
  221. iface_font_xs.pxlsz =
  222. iface_font_s.pxlsz = "14";
  223. iface_font_xxs.ptsz =
  224. iface_font_xs.ptsz =
  225. iface_font_s.ptsz = "130";
  226. iface_font_xxs.avgwdth =
  227. iface_font_xs.avgwdth =
  228. iface_font_s.avgwdth = "140";
  229. iface_font_xxl.pxlsz = "24";
  230. iface_font_xxl.ptsz = "230";
  231. iface_font_xxl.avgwdth = "240";
  232. }
  233. static void iface_ksc5601_1987_0(bool is_user, bool is_bold) {
  234. iface_iso8859(is_user, is_bold);
  235. for (int i = 0; i < IFACE_FAL_SIZE; ++i) {
  236. struct font_alias_t *pfa = &iface_fal[i];
  237. pfa->font->fndry = "daewoo";
  238. pfa->font->fmly = is_bold ? "mincho" : "gothic";
  239. pfa->font->wght = "medium";
  240. pfa->font->pxlsz = "16";
  241. pfa->font->ptsz = "120";
  242. pfa->font->resx =
  243. pfa->font->resy = "100";
  244. pfa->font->avgwdth = "160";
  245. pfa->font->rgstry = "ksc5601.1987";
  246. pfa->font->encdng = "0";
  247. pfa->alias->rgstry = pfa->font->rgstry;
  248. pfa->alias->encdng = pfa->font->encdng;
  249. }
  250. iface_font_xxl.fmly = "mincho";
  251. iface_font_xxl.pxlsz = "24";
  252. iface_font_xxl.ptsz = "170";
  253. iface_font_xxl.avgwdth = "240";
  254. }
  255. static void iface_gb2312_1980_0(bool is_user, bool is_bold) {
  256. iface_iso8859(is_user, is_bold);
  257. for (int i = 0; i < IFACE_FAL_SIZE; ++i) {
  258. struct font_alias_t *pfa = &iface_fal[i];
  259. pfa->font->fndry = "isas";
  260. pfa->font->fmly = is_bold ? "song ti" : "fangsong ti";
  261. pfa->font->wght = "medium";
  262. pfa->font->pxlsz = "16";
  263. pfa->font->ptsz = "160";
  264. pfa->font->resx =
  265. pfa->font->resy = "72";
  266. pfa->font->avgwdth = "160";
  267. pfa->font->rgstry = "gb2312.1980";
  268. pfa->font->encdng = "0";
  269. pfa->alias->rgstry = pfa->font->rgstry;
  270. pfa->alias->encdng = pfa->font->encdng;
  271. }
  272. iface_font_xxl.fmly = "song ti";
  273. iface_font_xxl.pxlsz = "24";
  274. iface_font_xxl.ptsz = "240";
  275. iface_font_xxl.avgwdth = "240";
  276. }
  277. static void print_iface(void (*fiface)(bool, bool), char *encdng) {
  278. for (int i = 0; i < 2; ++i) {
  279. for (int j = 0; j < 2; ++j) {
  280. fiface(i, j);
  281. for (int k = 0; k < IFACE_FAL_SIZE; ++k) {
  282. struct font_alias_t *pfa = &iface_fal[k];
  283. pfa->alias->encdng = pfa->font->encdng = encdng;
  284. print_font_alias(pfa);
  285. }
  286. }
  287. }
  288. }
  289. static void print_iface_iso8859(char *encdng) {
  290. print_iface(iface_iso8859, encdng);
  291. }
  292. static void print_iface_iso8859_11(void) {
  293. print_iface(iface_iso8859_11, "11");
  294. }
  295. static void print_iface_koi8_r(void) {
  296. print_iface(iface_koi8_r, "r");
  297. }
  298. static void print_iface_jisx0201_1976_0(void) {
  299. print_iface(iface_jisx0201_1976_0, "0");
  300. }
  301. static void print_iface_jisx0208_1983_0(void) {
  302. print_iface(iface_jisx0208_1983_0, "0");
  303. }
  304. static void print_iface_ksc5601_1987_0(void) {
  305. print_iface(iface_ksc5601_1987_0, "0");
  306. }
  307. static void print_iface_gb2312_1980_0(void) {
  308. print_iface(iface_gb2312_1980_0, "0");
  309. }
  310. static void app_iso8859_full(enum app_adstyl_spc_t adstyl_spc, bool is_bold,
  311. bool is_italic)
  312. {
  313. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  314. struct font_alias_t *pfa = &app_fal[i];
  315. memset(pfa->font, 0, sizeof(struct xlfd_t));
  316. memset(pfa->alias, 0, sizeof(struct xlfd_t));
  317. pfa->font->swdth = "normal";
  318. pfa->font->adstyl = "";
  319. pfa->font->resx =
  320. pfa->font->resy = i % 2 ? "100" : "75";
  321. pfa->font->rgstry = "iso8859";
  322. pfa->alias->fndry = "dt";
  323. pfa->alias->fmly = "application";
  324. }
  325. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  326. struct font_alias_t *pfa = &app_fal[i];
  327. pfa->font->fndry = "adobe";
  328. pfa->font->fmly = "courier";
  329. pfa->font->wght = is_bold ? "bold" : "medium";
  330. pfa->font->slant = is_italic ? "o" : "r";
  331. pfa->font->spc = "m";
  332. pfa->alias->slant = is_italic ? "i" : "r";
  333. pfa->alias->adstyl = "serif";
  334. switch (i) {
  335. case 0:
  336. pfa->font->pxlsz = "8";
  337. pfa->font->ptsz = "80";
  338. pfa->font->avgwdth = "50";
  339. break;
  340. case 2:
  341. pfa->font->pxlsz = "10";
  342. pfa->font->ptsz = "100";
  343. pfa->font->avgwdth = "60";
  344. break;
  345. case 4:
  346. pfa->font->pxlsz = "12";
  347. pfa->font->ptsz = "120";
  348. pfa->font->avgwdth = "70";
  349. break;
  350. case 6:
  351. pfa->font->pxlsz = "14";
  352. pfa->font->ptsz = "140";
  353. pfa->font->avgwdth = "90";
  354. break;
  355. case 8:
  356. pfa->font->pxlsz = "18";
  357. pfa->font->ptsz = "180";
  358. pfa->font->avgwdth = "110";
  359. break;
  360. case 10:
  361. pfa->font->pxlsz = "24";
  362. pfa->font->ptsz = "240";
  363. pfa->font->avgwdth = "150";
  364. break;
  365. case 1:
  366. pfa->font->pxlsz = "11";
  367. pfa->font->ptsz = "80";
  368. pfa->font->avgwdth = "60";
  369. break;
  370. case 3:
  371. pfa->font->pxlsz = "14";
  372. pfa->font->ptsz = "100";
  373. pfa->font->avgwdth = "90";
  374. break;
  375. case 5:
  376. pfa->font->pxlsz = "17";
  377. pfa->font->ptsz = "120";
  378. pfa->font->avgwdth = "100";
  379. break;
  380. case 7:
  381. pfa->font->pxlsz = "20";
  382. pfa->font->ptsz = "140";
  383. pfa->font->avgwdth = "110";
  384. break;
  385. case 9:
  386. pfa->font->pxlsz = "25";
  387. pfa->font->ptsz = "180";
  388. pfa->font->avgwdth = "150";
  389. break;
  390. case 11:
  391. pfa->font->pxlsz = "34";
  392. pfa->font->ptsz = "240";
  393. pfa->font->avgwdth = "200";
  394. break;
  395. }
  396. }
  397. if (adstyl_spc == SERIF_M) goto done;
  398. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  399. struct font_alias_t *pfa = &app_fal[i];
  400. pfa->font->fndry = "adobe";
  401. pfa->font->fmly = "helvetica";
  402. pfa->font->wght = "medium";
  403. pfa->font->slant = "r";
  404. pfa->font->spc = "p";
  405. pfa->alias->slant = pfa->font->slant;
  406. pfa->alias->adstyl = "sans";
  407. switch (i) {
  408. case 0:
  409. pfa->font->pxlsz = "8";
  410. pfa->font->ptsz = "80";
  411. pfa->font->avgwdth = "46";
  412. break;
  413. case 2:
  414. pfa->font->pxlsz = "10";
  415. pfa->font->ptsz = "100";
  416. pfa->font->avgwdth = "56";
  417. break;
  418. case 4:
  419. pfa->font->pxlsz = "12";
  420. pfa->font->ptsz = "120";
  421. pfa->font->avgwdth = "67";
  422. break;
  423. case 6:
  424. pfa->font->pxlsz = "14";
  425. pfa->font->ptsz = "140";
  426. pfa->font->avgwdth = "77";
  427. break;
  428. case 8:
  429. pfa->font->pxlsz = "18";
  430. pfa->font->ptsz = "180";
  431. pfa->font->avgwdth = "98";
  432. break;
  433. case 10:
  434. pfa->font->pxlsz = "24";
  435. pfa->font->ptsz = "240";
  436. pfa->font->avgwdth = "130";
  437. break;
  438. case 1:
  439. pfa->font->pxlsz = "11";
  440. pfa->font->ptsz = "80";
  441. pfa->font->avgwdth = "56";
  442. break;
  443. case 3:
  444. pfa->font->pxlsz = "14";
  445. pfa->font->ptsz = "100";
  446. pfa->font->avgwdth = "76";
  447. break;
  448. case 5:
  449. pfa->font->pxlsz = "17";
  450. pfa->font->ptsz = "120";
  451. pfa->font->avgwdth = "88";
  452. break;
  453. case 7:
  454. pfa->font->pxlsz = "20";
  455. pfa->font->ptsz = "140";
  456. pfa->font->avgwdth = "100";
  457. break;
  458. case 9:
  459. pfa->font->pxlsz = "25";
  460. pfa->font->ptsz = "180";
  461. pfa->font->avgwdth = "130";
  462. break;
  463. case 11:
  464. pfa->font->pxlsz = "34";
  465. pfa->font->ptsz = "240";
  466. pfa->font->avgwdth = "176";
  467. break;
  468. }
  469. }
  470. if (adstyl_spc == SANS_P && !is_bold && !is_italic) goto done;
  471. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  472. struct font_alias_t *pfa = &app_fal[i];
  473. pfa->font->slant = "o";
  474. pfa->alias->slant = "i";
  475. switch (i) {
  476. case 0: pfa->font->avgwdth = "47"; break;
  477. case 2: pfa->font->avgwdth = "57"; break;
  478. case 4: pfa->font->avgwdth = "67"; break;
  479. case 6: pfa->font->avgwdth = "78"; break;
  480. case 8: pfa->font->avgwdth = "98"; break;
  481. case 10: pfa->font->avgwdth = "130"; break;
  482. case 1: pfa->font->avgwdth = "57"; break;
  483. case 3: pfa->font->avgwdth = "78"; break;
  484. case 5: pfa->font->avgwdth = "88"; break;
  485. case 7: pfa->font->avgwdth = "98"; break;
  486. case 9: pfa->font->avgwdth = "130"; break;
  487. case 11: pfa->font->avgwdth = "176"; break;
  488. }
  489. }
  490. if (adstyl_spc == SANS_P && !is_bold && is_italic) goto done;
  491. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  492. struct font_alias_t *pfa = &app_fal[i];
  493. pfa->font->wght = "bold";
  494. pfa->font->slant = "r";
  495. pfa->alias->slant = pfa->font->slant;
  496. switch (i) {
  497. case 0: pfa->font->avgwdth = "50"; break;
  498. case 2: pfa->font->avgwdth = "60"; break;
  499. case 4: pfa->font->avgwdth = "70"; break;
  500. case 6: pfa->font->avgwdth = "82"; break;
  501. case 8: pfa->font->avgwdth = "103"; break;
  502. case 10: pfa->font->avgwdth = "138"; break;
  503. case 1: pfa->font->avgwdth = "60"; break;
  504. case 3: pfa->font->avgwdth = "82"; break;
  505. case 5: pfa->font->avgwdth = "92"; break;
  506. case 7: pfa->font->avgwdth = "105"; break;
  507. case 9: pfa->font->avgwdth = "138"; break;
  508. case 11: pfa->font->avgwdth = "182"; break;
  509. }
  510. }
  511. if (adstyl_spc == SANS_P && is_bold && !is_italic) goto done;
  512. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  513. struct font_alias_t *pfa = &app_fal[i];
  514. pfa->font->slant = "o";
  515. pfa->alias->slant = "i";
  516. switch (i) {
  517. case 0: pfa->font->avgwdth = "50"; break;
  518. case 2: pfa->font->avgwdth = "60"; break;
  519. case 4: pfa->font->avgwdth = "69"; break;
  520. case 6: pfa->font->avgwdth = "82"; break;
  521. case 8: pfa->font->avgwdth = "104"; break;
  522. case 10: pfa->font->avgwdth = "138"; break;
  523. case 1: pfa->font->avgwdth = "60"; break;
  524. case 3: pfa->font->avgwdth = "82"; break;
  525. case 5: pfa->font->avgwdth = "92"; break;
  526. case 7: pfa->font->avgwdth = "103"; break;
  527. case 9: pfa->font->avgwdth = "138"; break;
  528. case 11: pfa->font->avgwdth = "182"; break;
  529. }
  530. }
  531. if (adstyl_spc == SANS_P && is_bold && is_italic) goto done;
  532. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  533. struct font_alias_t *pfa = &app_fal[i];
  534. pfa->font->fndry = "adobe";
  535. pfa->font->fmly = "times";
  536. pfa->font->wght = "medium";
  537. pfa->font->slant = "r";
  538. pfa->font->spc = "p";
  539. pfa->alias->slant = pfa->font->slant;
  540. pfa->alias->adstyl = "serif";
  541. switch (i) {
  542. case 0:
  543. pfa->font->pxlsz = "8";
  544. pfa->font->ptsz = "80";
  545. pfa->font->avgwdth = "44";
  546. break;
  547. case 2:
  548. pfa->font->pxlsz = "10";
  549. pfa->font->ptsz = "100";
  550. pfa->font->avgwdth = "54";
  551. break;
  552. case 4:
  553. pfa->font->pxlsz = "12";
  554. pfa->font->ptsz = "120";
  555. pfa->font->avgwdth = "64";
  556. break;
  557. case 6:
  558. pfa->font->pxlsz = "14";
  559. pfa->font->ptsz = "140";
  560. pfa->font->avgwdth = "74";
  561. break;
  562. case 8:
  563. pfa->font->pxlsz = "18";
  564. pfa->font->ptsz = "180";
  565. pfa->font->avgwdth = "94";
  566. break;
  567. case 10:
  568. pfa->font->pxlsz = "24";
  569. pfa->font->ptsz = "240";
  570. pfa->font->avgwdth = "124";
  571. break;
  572. case 1:
  573. pfa->font->pxlsz = "11";
  574. pfa->font->ptsz = "80";
  575. pfa->font->avgwdth = "54";
  576. break;
  577. case 3:
  578. pfa->font->pxlsz = "14";
  579. pfa->font->ptsz = "100";
  580. pfa->font->avgwdth = "74";
  581. break;
  582. case 5:
  583. pfa->font->pxlsz = "17";
  584. pfa->font->ptsz = "120";
  585. pfa->font->avgwdth = "84";
  586. break;
  587. case 7:
  588. pfa->font->pxlsz = "20";
  589. pfa->font->ptsz = "140";
  590. pfa->font->avgwdth = "96";
  591. break;
  592. case 9:
  593. pfa->font->pxlsz = "25";
  594. pfa->font->ptsz = "180";
  595. pfa->font->avgwdth = "125";
  596. break;
  597. case 11:
  598. pfa->font->pxlsz = "34";
  599. pfa->font->ptsz = "240";
  600. pfa->font->avgwdth = "170";
  601. break;
  602. }
  603. }
  604. if (adstyl_spc == SERIF_P && !is_bold && !is_italic) goto done;
  605. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  606. struct font_alias_t *pfa = &app_fal[i];
  607. pfa->font->slant = "i";
  608. pfa->alias->slant = pfa->font->slant;
  609. switch (i) {
  610. case 0: pfa->font->avgwdth = "42"; break;
  611. case 2: pfa->font->avgwdth = "52"; break;
  612. case 4: pfa->font->avgwdth = "63"; break;
  613. case 6: pfa->font->avgwdth = "73"; break;
  614. case 8: pfa->font->avgwdth = "94"; break;
  615. case 10: pfa->font->avgwdth = "125"; break;
  616. case 1: pfa->font->avgwdth = "52"; break;
  617. case 3: pfa->font->avgwdth = "73"; break;
  618. case 5: pfa->font->avgwdth = "84"; break;
  619. case 7: pfa->font->avgwdth = "94"; break;
  620. case 9: pfa->font->avgwdth = "125"; break;
  621. case 11: pfa->font->avgwdth = "168"; break;
  622. }
  623. }
  624. if (adstyl_spc == SERIF_P && !is_bold && is_italic) goto done;
  625. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  626. struct font_alias_t *pfa = &app_fal[i];
  627. pfa->font->wght = "bold";
  628. pfa->font->slant = "r";
  629. pfa->alias->slant = pfa->font->slant;
  630. switch (i) {
  631. case 0: pfa->font->avgwdth = "47"; break;
  632. case 2: pfa->font->avgwdth = "57"; break;
  633. case 4: pfa->font->avgwdth = "67"; break;
  634. case 6: pfa->font->avgwdth = "77"; break;
  635. case 8: pfa->font->avgwdth = "99"; break;
  636. case 10: pfa->font->avgwdth = "132"; break;
  637. case 1: pfa->font->avgwdth = "57"; break;
  638. case 3: pfa->font->avgwdth = "76"; break;
  639. case 5: pfa->font->avgwdth = "88"; break;
  640. case 7: pfa->font->avgwdth = "100"; break;
  641. case 9: pfa->font->avgwdth = "132"; break;
  642. case 11: pfa->font->avgwdth = "177"; break;
  643. }
  644. }
  645. if (adstyl_spc == SERIF_P && is_bold && !is_italic) goto done;
  646. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  647. struct font_alias_t *pfa = &app_fal[i];
  648. pfa->font->slant = "i";
  649. pfa->alias->slant = pfa->font->slant;
  650. switch (i) {
  651. case 0: pfa->font->avgwdth = "47"; break;
  652. case 2: pfa->font->avgwdth = "57"; break;
  653. case 4: pfa->font->avgwdth = "68"; break;
  654. case 6: pfa->font->avgwdth = "77"; break;
  655. case 8: pfa->font->avgwdth = "98"; break;
  656. case 10: pfa->font->avgwdth = "128"; break;
  657. case 1: pfa->font->avgwdth = "57"; break;
  658. case 3: pfa->font->avgwdth = "77"; break;
  659. case 5: pfa->font->avgwdth = "86"; break;
  660. case 7: pfa->font->avgwdth = "98"; break;
  661. case 9: pfa->font->avgwdth = "128"; break;
  662. case 11: pfa->font->avgwdth = "170"; break;
  663. }
  664. }
  665. if (adstyl_spc == SERIF_P && is_bold && is_italic) goto done;
  666. done:
  667. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  668. struct font_alias_t *pfa = &app_fal[i];
  669. pfa->alias->wght = pfa->font->wght;
  670. pfa->alias->swdth = pfa->font->swdth;
  671. pfa->alias->pxlsz = pfa->font->pxlsz;
  672. pfa->alias->ptsz = pfa->font->ptsz;
  673. pfa->alias->resx = pfa->font->resx;
  674. pfa->alias->resy = pfa->font->resy;
  675. pfa->alias->spc = pfa->font->spc;
  676. pfa->alias->avgwdth = pfa->font->avgwdth;
  677. pfa->alias->rgstry = pfa->font->rgstry;
  678. pfa->alias->encdng = pfa->font->encdng;
  679. }
  680. }
  681. static void app_iso8859_partial(enum app_adstyl_spc_t adstyl_spc, bool is_bold,
  682. bool is_italic)
  683. {
  684. app_iso8859_full(adstyl_spc, is_bold, is_italic);
  685. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  686. struct font_alias_t *pfa = &app_fal[i];
  687. pfa->font->fndry = "misc";
  688. pfa->font->fmly = "fixed";
  689. pfa->font->wght = "medium";
  690. pfa->font->slant = "r";
  691. pfa->font->resx =
  692. pfa->font->resy = "75";
  693. pfa->font->spc = "c";
  694. switch (i) {
  695. case 0:
  696. pfa->font->pxlsz = "8";
  697. pfa->font->ptsz = "80";
  698. pfa->font->avgwdth = "50";
  699. break;
  700. case 1:
  701. case 2:
  702. pfa->font->pxlsz = "10";
  703. pfa->font->ptsz = "100";
  704. pfa->font->avgwdth = "60";
  705. break;
  706. case 3:
  707. case 6:
  708. pfa->font->wght = is_bold ? "bold" : "medium";
  709. pfa->font->pxlsz = "14";
  710. pfa->font->ptsz = "130";
  711. pfa->font->avgwdth = "70";
  712. break;
  713. case 4:
  714. pfa->font->wght = is_bold ? "bold" : "medium";
  715. pfa->font->pxlsz = "13";
  716. pfa->font->ptsz = "120";
  717. pfa->font->avgwdth = "70";
  718. break;
  719. case 5:
  720. case 8:
  721. pfa->font->wght = is_bold ? "bold" : "medium";
  722. pfa->font->pxlsz = "18";
  723. pfa->font->ptsz = "120";
  724. pfa->font->resx = "100";
  725. pfa->font->resy = pfa->font->resx;
  726. pfa->font->avgwdth = "90";
  727. break;
  728. case 7:
  729. case 9:
  730. case 10:
  731. case 11:
  732. pfa->font->pxlsz = "20";
  733. pfa->font->ptsz = "200";
  734. pfa->font->avgwdth = "100";
  735. break;
  736. }
  737. }
  738. }
  739. static void app_iso8859_11(enum app_adstyl_spc_t adstyl_spc, bool is_bold,
  740. bool is_italic)
  741. {
  742. app_iso8859_partial(adstyl_spc, is_bold, is_italic);
  743. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  744. struct font_alias_t *pfa = &app_fal[i];
  745. struct font_alias_t *p;
  746. pfa->font->encdng = "11";
  747. pfa->alias->encdng = pfa->font->encdng;
  748. switch (i) {
  749. case 0:
  750. case 1:
  751. case 2:
  752. p = &app_fal[4];
  753. pfa->font->wght = p->font->wght;
  754. pfa->font->pxlsz = p->font->pxlsz;
  755. pfa->font->ptsz = p->font->ptsz;
  756. pfa->font->avgwdth = p->font->avgwdth;
  757. break;
  758. case 5:
  759. case 8:
  760. pfa->font->wght = "medium";
  761. break;
  762. }
  763. }
  764. }
  765. static void app_koi8_r(enum app_adstyl_spc_t adstyl_spc, bool is_bold,
  766. bool is_italic)
  767. {
  768. app_iso8859_partial(adstyl_spc, is_bold, is_italic);
  769. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  770. struct font_alias_t *pfa = &app_fal[i];
  771. pfa->font->wght = "medium";
  772. pfa->font->rgstry = "koi8";
  773. pfa->font->encdng = "r";
  774. pfa->alias->rgstry = pfa->font->rgstry;
  775. pfa->alias->encdng = pfa->font->encdng;
  776. }
  777. }
  778. static void app_jisx0201_1976_0(enum app_adstyl_spc_t adstyl_spc, bool is_bold,
  779. bool is_italic)
  780. {
  781. app_iso8859_partial(adstyl_spc, is_bold, is_italic);
  782. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  783. struct font_alias_t *pfa = &app_fal[i];
  784. pfa->font->wght = "medium";
  785. pfa->font->pxlsz = "14";
  786. pfa->font->ptsz = "130";
  787. pfa->font->resx =
  788. pfa->font->resy = "75";
  789. pfa->font->avgwdth = "70";
  790. pfa->font->rgstry = "jisx0201.1976";
  791. pfa->font->encdng = "0";
  792. pfa->alias->rgstry = pfa->font->rgstry;
  793. pfa->alias->encdng = pfa->font->encdng;
  794. }
  795. }
  796. static void app_jisx0208_1983_0(enum app_adstyl_spc_t adstyl_spc, bool is_bold,
  797. bool is_italic)
  798. {
  799. app_jisx0201_1976_0(adstyl_spc, is_bold, is_italic);
  800. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  801. struct font_alias_t *pfa = &app_fal[i];
  802. pfa->font->fndry = "jis";
  803. pfa->font->rgstry = "jisx0208.1983";
  804. pfa->alias->rgstry = pfa->font->rgstry;
  805. switch (i) {
  806. case 0:
  807. case 1:
  808. case 2:
  809. case 3:
  810. case 4:
  811. case 6:
  812. pfa->font->fndry = "misc";
  813. pfa->font->avgwdth = "140";
  814. break;
  815. case 5:
  816. case 7:
  817. case 8:
  818. pfa->font->pxlsz = "16";
  819. pfa->font->ptsz = "150";
  820. pfa->font->avgwdth = "160";
  821. break;
  822. case 9:
  823. case 10:
  824. case 11:
  825. pfa->font->pxlsz = "24";
  826. pfa->font->ptsz = "230";
  827. pfa->font->avgwdth = "240";
  828. break;
  829. }
  830. }
  831. }
  832. static void app_ksc5601_1987_0(enum app_adstyl_spc_t adstyl_spc, bool is_bold,
  833. bool is_italic)
  834. {
  835. app_iso8859_partial(adstyl_spc, is_bold, is_italic);
  836. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  837. struct font_alias_t *pfa = &app_fal[i];
  838. pfa->font->fndry = "daewoo";
  839. pfa->font->fmly = "mincho";
  840. pfa->font->wght = "medium";
  841. pfa->font->resx =
  842. pfa->font->resy = "100";
  843. pfa->font->rgstry = "ksc5601.1987";
  844. pfa->font->encdng = "0";
  845. pfa->alias->rgstry = pfa->font->rgstry;
  846. pfa->alias->encdng = pfa->font->encdng;
  847. switch (i) {
  848. case 0:
  849. case 1:
  850. case 2:
  851. case 3:
  852. case 4:
  853. case 5:
  854. case 6:
  855. case 7:
  856. case 8:
  857. pfa->font->fmly = is_bold ? "mincho" : "gothic";
  858. pfa->font->pxlsz = "16";
  859. pfa->font->ptsz = "120";
  860. pfa->font->avgwdth = "160";
  861. break;
  862. case 9:
  863. case 10:
  864. case 11:
  865. pfa->font->pxlsz = "24";
  866. pfa->font->ptsz = "170";
  867. pfa->font->avgwdth = "240";
  868. break;
  869. }
  870. }
  871. }
  872. static void app_gb2312_1980_0(enum app_adstyl_spc_t adstyl_spc, bool is_bold,
  873. bool is_italic)
  874. {
  875. app_iso8859_partial(adstyl_spc, is_bold, is_italic);
  876. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  877. struct font_alias_t *pfa = &app_fal[i];
  878. pfa->font->fndry = "isas";
  879. pfa->font->fmly = "song ti";
  880. pfa->font->wght = "medium";
  881. pfa->font->resx =
  882. pfa->font->resy = "72";
  883. pfa->font->rgstry = "gb2312.1980";
  884. pfa->font->encdng = "0";
  885. pfa->alias->rgstry = pfa->font->rgstry;
  886. pfa->alias->encdng = pfa->font->encdng;
  887. switch (i) {
  888. case 0:
  889. case 1:
  890. case 2:
  891. case 3:
  892. case 4:
  893. case 5:
  894. case 6:
  895. case 7:
  896. case 8:
  897. pfa->font->fmly = is_bold ? "song ti" : "fangsong ti";
  898. pfa->font->pxlsz = "16";
  899. pfa->font->ptsz = "160";
  900. pfa->font->avgwdth = "160";
  901. break;
  902. case 9:
  903. case 10:
  904. case 11:
  905. pfa->font->pxlsz = "24";
  906. pfa->font->ptsz = "240";
  907. pfa->font->avgwdth = "240";
  908. break;
  909. }
  910. }
  911. }
  912. static void app_dtsymbol_1(void) {
  913. app_iso8859_full(SANS_P, false, false);
  914. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  915. struct font_alias_t *pfa = &app_fal[i];
  916. pfa->font->fndry = "adobe";
  917. pfa->font->fmly = "symbol";
  918. pfa->font->adstyl = "";
  919. pfa->font->rgstry = "adobe";
  920. pfa->font->encdng = "fontspecific";
  921. pfa->alias->adstyl = pfa->font->adstyl;
  922. pfa->alias->rgstry = "dtsymbol";
  923. pfa->alias->encdng = "1";
  924. switch (i) {
  925. case 0: pfa->font->avgwdth = "51"; break;
  926. case 2: pfa->font->avgwdth = "61"; break;
  927. case 4: pfa->font->avgwdth = "74"; break;
  928. case 6: pfa->font->avgwdth = "85"; break;
  929. case 8: pfa->font->avgwdth = "107"; break;
  930. case 10: pfa->font->avgwdth = "142"; break;
  931. case 1: pfa->font->avgwdth = "61"; break;
  932. case 3: pfa->font->avgwdth = "85"; break;
  933. case 5: pfa->font->avgwdth = "95"; break;
  934. case 7: pfa->font->avgwdth = "107"; break;
  935. case 9: pfa->font->avgwdth = "142"; break;
  936. case 11: pfa->font->avgwdth = "191"; break;
  937. }
  938. }
  939. }
  940. static void print_app(void (*fapp)(enum app_adstyl_spc_t, bool, bool),
  941. char *encdng)
  942. {
  943. for (int i = 0; i < 3; ++i) {
  944. for (int j = 0; j < 2; ++j) {
  945. for (int k = 0; k < 2; ++k) {
  946. fapp(i, j, k);
  947. for (int l = 0; l < APP_FAL_SIZE; ++l) {
  948. struct font_alias_t *pfa = &app_fal[l];
  949. pfa->alias->encdng = pfa->font->encdng = encdng;
  950. print_font_alias(pfa);
  951. }
  952. }
  953. }
  954. }
  955. }
  956. static void print_app_iso8859_full(char *encdng) {
  957. print_app(app_iso8859_full, encdng);
  958. }
  959. static void print_app_iso8859_partial(char *encdng) {
  960. print_app(app_iso8859_partial, encdng);
  961. }
  962. static void print_app_iso8859_11(void) {
  963. print_app(app_iso8859_11, "11");
  964. }
  965. static void print_app_koi8_r(void) {
  966. print_app(app_koi8_r, "r");
  967. }
  968. static void print_app_jisx0201_1976_0(void) {
  969. print_app(app_jisx0201_1976_0, "0");
  970. }
  971. static void print_app_jisx0208_1983_0(void) {
  972. print_app(app_jisx0208_1983_0, "0");
  973. }
  974. static void print_app_ksc5601_1987_0(void) {
  975. print_app(app_ksc5601_1987_0, "0");
  976. }
  977. static void print_app_gb2312_1980_0(void) {
  978. print_app(app_gb2312_1980_0, "0");
  979. }
  980. static void print_app_dtsymbol_1(void) {
  981. app_dtsymbol_1();
  982. for (int i = 0; i < APP_FAL_SIZE; ++i) print_font_alias(&app_fal[i]);
  983. }
  984. static void mixed_iface_iso8859(bool is_user, bool is_bold) {
  985. iface_iso8859(is_user, is_bold);
  986. if (!is_user && is_bold) return;
  987. for (int i = 0; i < IFACE_FAL_SIZE; ++i) {
  988. struct font_alias_t *pfa = &iface_fal[i];
  989. pfa->font->fndry = "b&h";
  990. pfa->font->fmly = is_user ? "lucidatypewriter" : "lucidabright";
  991. pfa->font->wght = is_bold ? "bold" : "medium";
  992. pfa->font->adstyl = is_user ? "sans" : "";
  993. pfa->font->spc = is_user ? "m" : "p";
  994. }
  995. if (!is_user) {
  996. iface_alias_xxs.adstyl = "xxs serif";
  997. iface_alias_xs.adstyl = "xs serif";
  998. iface_alias_s.adstyl = "s serif";
  999. iface_alias_m.adstyl = "m serif";
  1000. iface_alias_l.adstyl = "l serif";
  1001. iface_alias_xl.adstyl = "xl serif";
  1002. iface_alias_xxl.adstyl = "xxl serif";
  1003. }
  1004. iface_font_xxs.pxlsz = "10";
  1005. iface_font_xxs.ptsz = "100";
  1006. iface_font_xxs.resx = "75";
  1007. iface_font_xxs.resy = "75";
  1008. iface_font_xxs.avgwdth = is_user ? "60" : "56";
  1009. iface_font_xs.pxlsz = "11";
  1010. iface_font_xs.ptsz = "80";
  1011. iface_font_xs.resx = "100";
  1012. iface_font_xs.resy = "100";
  1013. iface_font_xs.avgwdth = is_user ? "70" : "63";
  1014. iface_font_s.pxlsz = "14";
  1015. iface_font_s.ptsz = "140";
  1016. iface_font_s.resx = "75";
  1017. iface_font_s.resy = "75";
  1018. iface_font_s.avgwdth = is_user ? "90" : "80";
  1019. iface_font_m.pxlsz = "17";
  1020. iface_font_m.ptsz = "120";
  1021. iface_font_m.resx = "100";
  1022. iface_font_m.resy = "100";
  1023. iface_font_m.avgwdth = is_user ? "100" : "96";
  1024. iface_font_l.pxlsz = "19";
  1025. iface_font_l.ptsz = "190";
  1026. iface_font_l.resx = "75";
  1027. iface_font_l.resy = "75";
  1028. iface_font_l.avgwdth = is_user ? "110" : "109";
  1029. iface_font_xl.pxlsz = "20";
  1030. iface_font_xl.ptsz = "140";
  1031. iface_font_xl.resx = "100";
  1032. iface_font_xl.resy = "100";
  1033. iface_font_xl.avgwdth = is_user ? "120" : "114";
  1034. iface_font_xxl.pxlsz = "24";
  1035. iface_font_xxl.ptsz = "240";
  1036. iface_font_xxl.resx = "75";
  1037. iface_font_xxl.resy = "75";
  1038. iface_font_xxl.avgwdth = is_user ? "140" : "137";
  1039. for (int i = 0; i < IFACE_FAL_SIZE; ++i) {
  1040. struct font_alias_t *pfa = &iface_fal[i];
  1041. pfa->alias->pxlsz = pfa->font->pxlsz;
  1042. pfa->alias->ptsz = pfa->font->ptsz;
  1043. pfa->alias->resx = pfa->font->resx;
  1044. pfa->alias->resy = pfa->font->resy;
  1045. pfa->alias->spc = pfa->font->spc;
  1046. pfa->alias->avgwdth = pfa->font->avgwdth;
  1047. }
  1048. }
  1049. static void print_mixed_iface_iso8859(char *encdng) {
  1050. print_iface(mixed_iface_iso8859, encdng);
  1051. }
  1052. int main(int argc, char *argv[]) {
  1053. for (int i = 0; i < APP_FAL_SIZE; ++i) {
  1054. struct font_alias_t *pfa = &app_fal[i];
  1055. pfa->font = &app_font[i];
  1056. pfa->alias = &app_alias[i];
  1057. }
  1058. char *iface_encdng[] = {
  1059. "1",
  1060. "2",
  1061. "3",
  1062. "4",
  1063. "5",
  1064. "7",
  1065. "8",
  1066. "9",
  1067. "10",
  1068. "13",
  1069. "14",
  1070. "15",
  1071. "16"
  1072. };
  1073. for (int i = 0; i < sizeof(iface_encdng) / sizeof(char *); ++i) {
  1074. char *encdng = iface_encdng[i];
  1075. if (argc > 1) {
  1076. if (strcmp(encdng, "5") &&
  1077. strcmp(encdng, "7") &&
  1078. strcmp(encdng, "8") &&
  1079. strcmp(encdng, "16"))
  1080. print_mixed_iface_iso8859(encdng);
  1081. }
  1082. else print_iface_iso8859(encdng);
  1083. }
  1084. print_iface_iso8859_11();
  1085. print_iface_koi8_r();
  1086. print_iface_jisx0201_1976_0();
  1087. print_iface_jisx0208_1983_0();
  1088. print_iface_ksc5601_1987_0();
  1089. print_iface_gb2312_1980_0();
  1090. char *app_full_encdng[] = {"1", "2", "3", "4", "9", "10", "13", "14", "15"};
  1091. for (int i = 0; i < sizeof(app_full_encdng) / sizeof(char *); ++i)
  1092. print_app_iso8859_full(app_full_encdng[i]);
  1093. char *app_partial_encdng[] = {"5", "7", "8", "16"};
  1094. for (int i = 0; i < sizeof(app_partial_encdng) / sizeof(char *); ++i)
  1095. print_app_iso8859_partial(app_partial_encdng[i]);
  1096. print_app_iso8859_11();
  1097. print_app_koi8_r();
  1098. print_app_jisx0201_1976_0();
  1099. print_app_jisx0208_1983_0();
  1100. print_app_ksc5601_1987_0();
  1101. print_app_gb2312_1980_0();
  1102. print_app_dtsymbol_1();
  1103. }