亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频

? 歡迎來到蟲蟲下載站! | ?? 資源下載 ?? 資源專輯 ?? 關于我們
? 蟲蟲下載站

?? cmap.c

?? ttfdump源代碼
?? C
?? 第 1 頁 / 共 2 頁
字號:
/* cmap.c -- Load and Print the content of cmap table * Copyright (C) 1996 Li-Da Lho, All right reserved  *  * The structure of a cmap is really complex, it depends on which format the  * cmap is and loading a cmap is a kind of confusing thing.  * The structure of CMAP: *   A cmap begins with a general description of the table *     USHORT version indicates the version of this cmap. *     USHORT numEncodings is the number of encodings in the cmap table. *   Then follow 'numEncodings' of encoding tables, each of which contains *   the following informations for each subtable. The subtable contains the  *   true data to map character code to glyph index *     USHORT PlatformID shows which platform the subtable is to be used  *            (e.g. Mac, PC) *     USHORT Platfrom specofic EncodingID shows what kind of encoding scheme *            this table uses (e.g. Big5, iso8859, Unicode etc.) *     ULONG  offset is the offset from the beginning of the whole cmap table *            to the beginning of the corresponding subtable * -----------------------         ---         --- * | USHORT version      |          ^           ^ * -----------------------          |           | * | USHORT numEncodings |          |           | * -----------------------          |           | * | Encoding Table 1    |          |           | * |  USHORT PlatformID  |          |           | * |  USHORT EncodingID  |          |           | * |  ULONG  offset 1    |------    |           | * -----------------------     |    |  offset 1 | offset 2 * | Encoding Table 2    |     |    |           | * |  USHORT PlatformID  |     |    |           | * |  USHORT EncodingID  |     |    |           | * |  ULONG  offset 2    |---  |    v           | * -----------------------  |  |   ---          | * | Subtable 1          |<-----                | * | with format 0       |  |                   v * -----------------------  |                  --- * | Subtable 2          |<--                 * | with format 2       | * ----------------------| * * Problem with Character Code vs. Byte Endianess. *  */#include <stdio.h>#include <stdlib.h>#include "config.h"#include "ttf.h"#include "ttfutil.h"#ifdef MEMCHECK#include <dmalloc.h>#endif/* 	$Id: cmap.c,v 1.1.1.1 1998/06/05 07:47:52 robert Exp $	 */#ifndef lintstatic char vcid[] = "$Id: cmap.c,v 1.1.1.1 1998/06/05 07:47:52 robert Exp $";#endif /* lint */static CMAPPtr ttfAllocCMAP(TTFontPtr font);static void ttfLoadCMAP(FILE *fp,CMAPPtr cmap,ULONG offset);static void ttfLoadEncodingTable(FILE *fp,SubTablePtr subTable,ULONG offset);static SubTablePtr ttfAllocSubTable(CMAPPtr cmap);static void ttfLoadSubTable(FILE *fp,SubTablePtr subTable,ULONG offset);static void ttfPrintSubTable(FILE* fp,SubTablePtr ptable);static void ttfFreeSubTable(SubTablePtr ptable);static CMAP0 * ttfAllocCMAP0(SubTablePtr subTable);static void ttfLoadCMAP0(FILE *fp,SubTablePtr subTable,ULONG offset);static void ttfPrintCMAP0(FILE *fp,SubTablePtr subTable);static USHORT ttfLookUpCMAP0(SubTablePtr subTable,USHORT cc);static void ttfFreeCMAP0(SubTablePtr subTable);static void ttfLoadCMAP2(FILE *fp,SubTablePtr subTable,ULONG offset);static void ttfPrintCMAP2(FILE *fp,SubTablePtr subTable);static USHORT ttfLookUpCMAP2(SubTablePtr subTable,USHORT cc);static void ttfFreeCMAP2(SubTablePtr subTable);static void ttfLoadCMAP4(FILE *fp,SubTablePtr subTable,ULONG offset);static void ttfPrintCMAP4(FILE *fp,SubTablePtr subTable);static USHORT ttfLookUpCMAP4(SubTablePtr subTable,USHORT cc);static void ttfFreeCMAP4(SubTablePtr subTable);static void ttfLoadCMAP6(FILE *fp,SubTablePtr subTable,ULONG offset);static void ttfPrintCMAP6(FILE *fp, SubTablePtr sbuTable);static USHORT ttfLookUpCMAP6(SubTablePtr subTable,USHORT cc);static void ttfFreeCMAP6(SubTablePtr subTable);void ttfInitCMAP(TTFontPtr font){    ULONG tag = 'c' | 'm' << 8 | 'a' << 16 | 'p' << 24;    TableDirPtr ptd;    if ((ptd = ttfLookUpTableDir(tag,font)) != NULL)	{	    font->cmap = ttfAllocCMAP(font);	    ttfLoadCMAP(font->fp,font->cmap,ptd->offset);	}}static CMAPPtr ttfAllocCMAP(TTFontPtr font){    CMAPPtr cmap;    if ((cmap = (CMAPPtr) calloc(1,sizeof(CMAP))) == NULL)	{	    ttfError("Out Of Memory in  __FILE_ : __LINE__ \n");	    return NULL;	}    return cmap;}static void ttfLoadCMAP(FILE *fp,CMAPPtr cmap,ULONG offset){    USHORT i,n;    ULONG posEnc;            /* beginning of the Encoding Table */    ULONG baseSub = offset;  /* base of SubTable offset */    if (fseek(fp,offset,SEEK_SET) !=0)	ttfError("Fseek Failed in ttfLOADCMAP \n");	    cmap->version = ttfGetUSHORT(fp);    cmap->numberOfEncodings = n = ttfGetUSHORT(fp);    cmap->subTables = ttfAllocSubTable(cmap);    posEnc = baseSub + sizeof(USHORT)*2; /* step over the beginning of encoding					  * table */        /* for each encoding scheme, load the encoding table (EncodingTable) and      * the real cmap data (SubTable) */    for (i=0;i<n;i++,posEnc += 8)	{   /* 8 == ushort*2 + ulong*1 */	    ttfLoadEncodingTable(fp,cmap->subTables+i,posEnc);	    ttfLoadSubTable(fp,cmap->subTables+i,baseSub);	}}void ttfPrintCMAP(FILE *fp,CMAPPtr cmap){    USHORT i;    fprintf(fp,"'cmap' Table - Character to Glyph Index Mapping Table\n");    fprintf(fp,"-----------------------------------------------------\n");    fprintf(fp,"\t 'cmap' version: %d\n",cmap->version);    fprintf(fp,"\t number of encoding: %d\n\n",cmap->numberOfEncodings);    for (i=0;i<cmap->numberOfEncodings;i++)	{	    fprintf(fp,"Subtable %3d.\t",i);	    ttfPrintSubTable(fp,cmap->subTables+i);	    fprintf(fp,"\n");	}}USHORT ttfLookUpCMAP(SubTablePtr subTable,USHORT cc){    USHORT idx,format = subTable->format;    switch (format)	{	case 0:	    idx = ttfLookUpCMAP0(subTable,cc);	    break;	case 2:	    idx = ttfLookUpCMAP2(subTable,cc);	    break;	case 4:	    idx = ttfLookUpCMAP4(subTable,cc);	    break;	case 6:	    idx = ttfLookUpCMAP6(subTable,cc);	    break;	default:	    ttfError("Unrecognized CMAP format\n");	    return 0;	}    return idx;}SubTablePtr ttfSelectCMAP(CMAPPtr cmap, USHORT PlatformID, USHORT EncodingID){    USHORT i;        for (i=0;i<cmap->numberOfEncodings;i++)	{	    if ((cmap->subTables+i)->PlatformID == PlatformID &&		(cmap->subTables+i)->EncodingID == EncodingID)		return cmap->subTables+i;	}    return NULL;}void ttfFreeCMAP(CMAPPtr cmap){    USHORT i;        for (i=0;i<cmap->numberOfEncodings;i++)	ttfFreeSubTable(cmap->subTables+i);    free(cmap->subTables);    free(cmap);}/* actually, EncodingTable is a part of SubTable */static void ttfLoadEncodingTable(FILE *fp,SubTablePtr subTable,ULONG offset){    if (fseek(fp,offset,SEEK_SET) !=0)	ttfError("Fseek Failed in ttfLoadEncodingTable \n");        subTable->PlatformID = ttfGetUSHORT(fp);    subTable->EncodingID = ttfGetUSHORT(fp);    subTable->offset = ttfGetULONG(fp);}static SubTablePtr ttfAllocSubTable(CMAPPtr cmap){    SubTablePtr subTable;        if ((subTable = (SubTablePtr) calloc(cmap->numberOfEncodings,sizeof(SubTable))) == NULL)	{	    ttfError("Out Of Memory in  __FILE__ : __LINE__ \n");	    return NULL;	}    return subTable;}/* should this one be static ? */static void ttfLoadSubTable(FILE *fp,SubTablePtr subTable,ULONG base){    ULONG pos;    USHORT format;    /* seek to the actuall position for this subtable     * base: beginning of cmap     * offset: offset field of each encoding table */    pos =  base  +  subTable->offset;    if (fseek(fp,pos,SEEK_SET) !=0)	ttfError("Fseek Failed in ttfLoadSubTable\n");    subTable->format = format = ttfGetUSHORT(fp);     subTable->length = ttfGetUSHORT(fp);    subTable->version = ttfGetUSHORT(fp);       pos += 6;/* step over format independent data,USHORT*3 */    switch(format)	{	case 0:	    ttfLoadCMAP0(fp,subTable,pos);	    break;	case 2:	    ttfLoadCMAP2(fp,subTable,pos);	    break;	case 4:	    ttfLoadCMAP4(fp,subTable,pos);	    break;	case 6:	    ttfLoadCMAP6(fp,subTable,pos);	    break;	default:	    ttfError("Unrecognized CMAP format\n");	}}static void ttfPrintSubTable(FILE* fp,SubTablePtr ptable){    USHORT format = ptable->format;        /* print encoding table */    fprintf(fp,    " PlatformID: %2d\n",ptable->PlatformID);    fprintf(fp,"\t\t EcodingID:  %2d\n",ptable->EncodingID);    fprintf(fp,"\t\t 'cmap' Offset: 0x%08x\n",ptable->offset);        /* print SubTable part */    fprintf(fp,"\t\t Length:  %6d\n",ptable->length);    fprintf(fp,"\t\t Version: %6d\n",ptable->version);    switch(format)	{	case 0:	    fprintf(fp,"\t\t Format 0 - Byte encoding table\n");	    ttfPrintCMAP0(fp,ptable);	    break;	case 2:	    fprintf(fp,"\t\t Format 2 - High-byte mapping through table\n");	    ttfPrintCMAP2(fp,ptable);	    break;	case 4:	    fprintf(fp,"\t\t Format 4 - Segment mapping to delta values\n");	    ttfPrintCMAP4(fp,ptable);	    break;	case 6:	    fprintf(fp,"\t\t Format 6 - Trimmed table mapping\n");	    ttfPrintCMAP6(fp,ptable);	    break;	default:	    ttfError("Unrecognized CMAP format\n");	}}static void ttfFreeSubTable(SubTablePtr ptable){    USHORT format = ptable->format;        switch(format)	{	case 0:	    ttfFreeCMAP0(ptable);	    break;	case 2:	    ttfFreeCMAP2(ptable);	    break;	case 4:	    ttfFreeCMAP4(ptable); 	    break;	case 6:	    ttfFreeCMAP6(ptable);	    break;	}}static CMAP0 * ttfAllocCMAP0(SubTablePtr subTable){    CMAP0 * cmap0;      if ((cmap0 = (CMAP0 *) calloc(1,sizeof(CMAP0))) == NULL)	{	    ttfError("Out Of Memory in  __FILE__ : __LINE__ \n");	    return NULL;	}    return cmap0;}static void ttfLoadCMAP0(FILE *fp,SubTablePtr subTable,ULONG offset){    BYTE * array;        subTable->map.cmap0 = ttfAllocCMAP0(subTable);    array = subTable->map.cmap0->glyphIndexArray;     if (fseek(fp,offset,SEEK_SET) != 0)	ttfError("Fseek Failed in ttfLoadCMAP0 \n");    /* Attention: we get lots of bytes at once as a work around of the     * usual ttfGet*, this cause byte sex trouble as will be seen     * in the fellowing procedures */    if (fread(array,sizeof(BYTE),256,fp) != 256)	ttfError("Error when getting glyphIndexArray \n");}static void ttfPrintCMAP0(FILE *fp,SubTablePtr subTable){    USHORT index;    int i;        for (i=0;i<256;i++)	{	    index = ttfLookUpCMAP(subTable,i);	    fprintf(fp,"\t\t Char %3d -> Index %4d \n",i,index);	}}static USHORT ttfLookUpCMAP0(SubTablePtr subTable,USHORT cc){    return subTable->map.cmap0->glyphIndexArray[cc & 0x00ff];}static void ttfFreeCMAP0(SubTablePtr subTable){    free(subTable->map.cmap0);}static void ttfLoadCMAP2(FILE *fp,SubTablePtr subTable,ULONG offset){    USHORT * array,i,n = 0;    USHORT numGlyphId;    SubHeaderPtr header;    if (fseek(fp,offset,SEEK_SET) != 0)	ttfError("Fseek Failed in ttfLoadCMAP2 \n");    subTable->map.cmap2 = (CMAP2 *) calloc(1,sizeof(CMAP2));    array = subTable->map.cmap2->subHeaderKeys;        if (fread(array,sizeof(USHORT),256,fp) != 256)	ttfError("Error when getting subHeaderKeys \n");#ifndef WORDS_BIGENDIAN    TwoByteSwap((unsigned char *) array,256*sizeof(USHORT));#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
欧美探花视频资源| 亚洲免费高清视频在线| 亚洲欧洲精品天堂一级| 天使萌一区二区三区免费观看| 极品瑜伽女神91| 欧美日韩国产天堂| 中文字幕一区二区三区四区| 久久99久久99精品免视看婷婷| 欧美亚洲高清一区二区三区不卡| 国产亚洲综合在线| 九色综合狠狠综合久久| 在线观看视频一区二区| 亚洲人成在线播放网站岛国| 韩日精品视频一区| 91精品国产aⅴ一区二区| 一区二区三区在线免费观看| 国产成人福利片| 日韩欧美中文字幕精品| 香蕉成人啪国产精品视频综合网 | 成人性视频网站| 欧美v国产在线一区二区三区| 亚洲一二三区视频在线观看| 日本久久电影网| 亚洲欧美另类图片小说| 99久久国产免费看| 日韩毛片视频在线看| aaa国产一区| 国产精品理论在线观看| www.欧美亚洲| 亚洲三级免费观看| 色综合欧美在线| 亚洲午夜久久久久久久久电影院 | 日韩欧美电影一二三| 日韩av电影天堂| 日韩午夜精品电影| 国产在线观看一区二区| 久久欧美一区二区| 国产精品69久久久久水密桃| 久久一区二区视频| 成人美女视频在线观看| 国产精品剧情在线亚洲| 97精品久久久午夜一区二区三区 | 91麻豆免费在线观看| 亚洲女人小视频在线观看| 欧美在线小视频| 无码av中文一区二区三区桃花岛| 91精品国产综合久久久久久久| 美洲天堂一区二卡三卡四卡视频| 精品欧美一区二区久久| 国产98色在线|日韩| 亚洲欧洲制服丝袜| 欧美日韩免费电影| 韩国v欧美v日本v亚洲v| 国产精品久久久久婷婷| 在线免费一区三区| 免费在线观看日韩欧美| 亚洲国产精品精华液2区45| 一道本成人在线| 青娱乐精品视频在线| 亚洲国产精品成人久久综合一区| 91香蕉视频污在线| 人人狠狠综合久久亚洲| 中文字幕 久热精品 视频在线 | 日韩欧美专区在线| av电影在线观看完整版一区二区| 亚洲一区二区在线视频| 久久伊99综合婷婷久久伊| 在线观看网站黄不卡| 精品一区二区国语对白| 自拍偷拍亚洲激情| 亚洲精品在线观看网站| 欧美在线视频你懂得| 国产精品91一区二区| 亚洲综合免费观看高清完整版在线| 日韩一卡二卡三卡国产欧美| 91亚洲国产成人精品一区二区三| 日韩电影一区二区三区| 亚洲视频在线观看一区| 精品女同一区二区| 欧美另类一区二区三区| bt欧美亚洲午夜电影天堂| 蜜臀av一级做a爰片久久| 亚洲精品一卡二卡| 中文字幕欧美国产| 欧美xxxxx裸体时装秀| 欧美性色aⅴ视频一区日韩精品| 国产黄色91视频| 日产精品久久久久久久性色| 亚洲免费观看高清完整版在线 | 欧美一区二区三区系列电影| 99在线精品视频| 九一九一国产精品| 天堂va蜜桃一区二区三区| 亚洲美女少妇撒尿| 国产精品午夜免费| 国产日韩欧美不卡在线| 欧美大尺度电影在线| 欧美日韩精品一区二区在线播放| 91丨九色丨国产丨porny| 国产福利91精品一区| 精品一区二区影视| 激情伊人五月天久久综合| 日本成人在线网站| 午夜伊人狠狠久久| 亚洲电影第三页| 亚洲国产精品久久久久婷婷884| 国产精品美女久久久久久久网站| 久久久久久久久免费| 亚洲精品一区二区三区影院| 日韩一区二区视频| 日韩一级完整毛片| 欧美xxxxxxxxx| 久久男人中文字幕资源站| 精品精品国产高清a毛片牛牛| 欧美一区二区三区在线视频 | 午夜精品成人在线| 天天做天天摸天天爽国产一区 | 中文字幕在线一区免费| 国产欧美一区二区精品秋霞影院 | 日韩精品一区二区三区视频在线观看| 欧美日韩在线电影| 欧美一二三区精品| 26uuuu精品一区二区| 国产欧美日本一区视频| 国产精品视频一二| 一区二区三区中文字幕精品精品| 亚洲黄一区二区三区| 亚洲一区二区美女| 免费人成在线不卡| 国产91精品精华液一区二区三区 | 欧美视频日韩视频在线观看| 欧美日韩一二区| 日韩一区二区精品| 国产丝袜美腿一区二区三区| 亚洲图片另类小说| 奇米综合一区二区三区精品视频| 极品少妇xxxx偷拍精品少妇| 国产.欧美.日韩| 在线观看成人免费视频| 日韩视频在线你懂得| 中文久久乱码一区二区| 一二三四区精品视频| 麻豆精品一区二区三区| 国产.欧美.日韩| 欧美精品丝袜久久久中文字幕| 日韩午夜在线观看视频| 国产精品久久久久国产精品日日| 亚洲在线视频网站| 国产精品一区二区久久不卡 | 日韩欧美国产一二三区| 中文字幕av免费专区久久| 亚洲成a人v欧美综合天堂下载| 美女国产一区二区| 色综合天天综合狠狠| 欧美一区二区在线免费播放 | av资源网一区| 欧美一级二级在线观看| 成人欧美一区二区三区视频网页| 亚洲va欧美va国产va天堂影院| 狠狠久久亚洲欧美| 欧美日韩在线播放三区| 中国色在线观看另类| 青青草国产精品97视觉盛宴| 国产91对白在线观看九色| 欧美少妇bbb| 国产精品久久久久四虎| 久久精品久久久精品美女| 日本高清不卡视频| 中文字幕va一区二区三区| 麻豆精品久久久| 欧美日韩免费高清一区色橹橹 | 91丨九色丨蝌蚪富婆spa| 2021国产精品久久精品| 日日夜夜精品视频天天综合网| caoporn国产精品| 久久九九全国免费| 久久成人免费网站| 日韩一区二区在线看片| 亚洲国产日韩一级| 日本福利一区二区| 中文字幕在线播放不卡一区| 国产在线一区二区| 欧美一区日韩一区| 日本伊人精品一区二区三区观看方式 | 久久天堂av综合合色蜜桃网| 五月综合激情网| 欧美日韩精品三区| 亚洲国产一区二区在线播放| 91玉足脚交白嫩脚丫在线播放| 亚洲国产激情av| 成人精品国产免费网站| 久久精品在线观看| 国产成人综合在线观看| 久久久精品黄色| 国产91丝袜在线播放0| 久久久三级国产网站| 国产一区二区在线免费观看| 久久亚洲影视婷婷| 岛国精品一区二区| 国产精品亲子伦对白|