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

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

?? fdbfont.c

?? Ming is a library for generating Macromedia Flash files (.swf), written in C, and includes useful ut
?? C
字號:
/*Ming, an SWF output libraryCopyright (C) 2002	Opaque Industries - http://www.opaque.net/This library is free software; you can redistribute it and/ormodify it under the terms of the GNU Lesser General PublicLicense as published by the Free Software Foundation; eitherversion 2.1 of the License, or (at your option) any later version.This library is distributed in the hope that it will be useful,but WITHOUT ANY WARRANTY; without even the implied warranty ofMERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.	See the GNULesser General Public License for more details.You should have received a copy of the GNU Lesser General PublicLicense along with this library; if not, write to the Free SoftwareFoundation, Inc., 59 Temple Place, Suite 330, Boston, MA	02111-1307	USA*//* $Id: fdbfont.c,v 1.8 2008/02/18 15:32:38 krechert Exp $ */#include <math.h>#include <stdio.h>#include <string.h>#include <stdlib.h>#include "font.h"#include "method.h"#include "utf8.h"#include "character.h"#include "error.h"#include "movie.h"#include "libming.h"#include "input.h"#include "shape.h"static voidreadBounds(SWFInput input, struct SWFRect_s* bounds){	int nBits;	SWFInput_byteAlign(input);	nBits = SWFInput_readBits(input, 5);	bounds->minX = SWFInput_readSBits(input, nBits);	bounds->maxX = SWFInput_readSBits(input, nBits);	bounds->minY = SWFInput_readSBits(input, nBits);	bounds->maxY = SWFInput_readSBits(input, nBits);}static voidreadKernInfo(SWFInput input, struct kernInfo *kern){	kern->code1 = SWFInput_getChar(input);	kern->code2 = SWFInput_getChar(input);	kern->adjustment = SWFInput_getSInt16(input);}static voidreadKernInfo16(SWFInput input, struct kernInfo16 *kern){	kern->code1 = SWFInput_getUInt16(input);	kern->code2 = SWFInput_getUInt16(input);	kern->adjustment = SWFInput_getSInt16(input);}static inline void checkShapeHeader(SWFInput input,                                    int *numFillBits,                                    int *numLineBits){	SWFInput_byteAlign(input);	if ( (*numFillBits = SWFInput_readBits(input, 4)) != 1 ) /* fill bits */		SWF_error("FdbFont read glyph: bad file format (was expecting fill bits = 1)\n");	if ( (*numLineBits = SWFInput_readBits(input, 4)) > 0 ) /* line bits */		SWF_error("FdbFont read glyph: bad file format (was expecting line bits = 0)\n");}static inline void checkShapeStyle(SWFInput input, char style,                             int numFillBits, int numLineBits){	if ( style & 1 )		if ( SWFInput_readBits(input, numFillBits) != 0 ) /* fill0 = 0 */			SWF_error("SWFFont_getShape: bad file format (was expecting fill0 = 0)");	if ( style & 2 )		if ( SWFInput_readBits(input, numFillBits) != 1 ) /* fill1 = 1 */			SWF_error("SWFFont_getShape: bad file format (was expecting fill1 = 1)");	if ( style & 4 )		if ( SWFInput_readBits(input, numLineBits) != 0 ) /* line = 1 */			SWF_error("SWFFont_getShape: bad file format (was expecting line = 0)");}static int translateShapeRecord(SWFInput input, SWFShape shape){	int moveBits, x = 0, y = 0;	int straight, numBits;	if ( SWFInput_readBits(input, 1) == 0 )	{		/* it's a moveTo or a shape end */		if ( SWFInput_readBits(input, 5) == 0 )			return 0; /* shape end */		moveBits = SWFInput_readBits(input, 5);		x = SWFInput_readSBits(input, moveBits);		y = SWFInput_readSBits(input, moveBits);		SWFShape_moveScaledPenTo(shape, x, y);		return 1;	}	straight = SWFInput_readBits(input, 1);	numBits = SWFInput_readBits(input, 4) + 2;	if (straight == 1)	{		if ( SWFInput_readBits(input, 1) ) /* general line */		{			x = SWFInput_readSBits(input, numBits);			y = SWFInput_readSBits(input, numBits);		}		else		{			if ( SWFInput_readBits(input, 1) ) /* vert = 1 */				y = SWFInput_readSBits(input, numBits);			else				x = SWFInput_readSBits(input, numBits);		}		SWFShape_drawScaledLine(shape, x, y);	}	else	{		int controlX = SWFInput_readSBits(input, numBits);		int controlY = SWFInput_readSBits(input, numBits);		int anchorX = SWFInput_readSBits(input, numBits);		int anchorY = SWFInput_readSBits(input, numBits);		SWFShape_drawScaledCurve(shape, controlX, controlY,			anchorX, anchorY);	}	return 1;}static SWFShape readGlyphShape(SWFInput input){	int numFillBits, numLineBits, moveBits, x, y;	char style;	SWFShape shape;	checkShapeHeader(input, &numFillBits, &numLineBits);	SWFInput_readBits(input, 2); /* type 0, newstyles */	style = SWFInput_readBits(input, 3);	shape = newSWFGlyphShape();	if (SWFInput_readBits(input, 1))	{	moveBits = SWFInput_readBits(input, 5);		x = SWFInput_readSBits(input, moveBits);		y = SWFInput_readSBits(input, moveBits);		SWFShape_moveScaledPenTo(shape, x, y);	}	else if (style == 0)	/* no style, no move => space character */	{		return shape;	}	checkShapeStyle(input, style, numFillBits, numLineBits);		/* translate the glyph's shape records into drawing commands */	while (translateShapeRecord(input, shape))		;	return shape;}static inline int readFontLayout(SWFInput input, SWFFont font){	int i;	struct SWFRect_s __rect;	font->advances = (short *)malloc(			font->nGlyphs * sizeof(short));	font->ascent = SWFInput_getSInt16(input);	font->descent = SWFInput_getSInt16(input);	font->leading = SWFInput_getSInt16(input);		/* get advances */	for (i = 0; i < font->nGlyphs; ++i )		font->advances[i] = SWFInput_getSInt16(input);	// temp hack	for (i = 0; i < font->nGlyphs; ++i )		readBounds(input, &__rect);		/* get kern table */	font->kernCount = SWFInput_getUInt16(input);	if ( font->kernCount > 0 )	{		if(font->flags & SWF_FONT_WIDECODES)			font->kernTable.w = (struct kernInfo16*) malloc(sizeof(struct kernInfo16) * font->kernCount);		else			font->kernTable.k = (struct kernInfo*)malloc(sizeof(struct kernInfo) * font->kernCount);	}	else		font->kernTable.k = NULL;	if(font->flags & SWF_FONT_WIDECODES)	{		for (i = 0; i < font->kernCount; ++i )			readKernInfo16(input, &(font->kernTable.w[i]));	}	else	{		for (i = 0; i < font->kernCount; ++i )			readKernInfo(input, &(font->kernTable.k[i]));	}	return 0;}static inline int checkFdbHeader(SWFInput input){	char f, d, b, z;	f = SWFInput_getChar(input);	d = SWFInput_getChar(input);	b = SWFInput_getChar(input);;	z = SWFInput_getChar(input);	if(f != 'f' || d != 'd' || b != 'b' || z != '0')	{			SWF_warn("loadSWFFont: not a fdb file\n");		return -1;	}		return 0;}SWFFont loadSWFFontFromInput(SWFInput input){	SWFFont font; 	int namelen, flags, i, nGlyphs;	if(input == NULL)		return NULL;	if(checkFdbHeader(input) < 0)		return NULL;	font = newSWFFont();		flags = SWFInput_getChar(input);	font->flags = flags;	font->langCode = SWFInput_getChar(input); 	namelen = SWFInput_getChar(input);	font->name = (char *) malloc(namelen + 1);	for ( i=0; i < namelen; ++i )		font->name[i] = SWFInput_getChar(input);	font->name[namelen] = '\0';	nGlyphs = SWFInput_getUInt16(input);	font->nGlyphs = nGlyphs;	font->glyphToCode = (unsigned short*)malloc(nGlyphs * sizeof(short));		if ( flags & SWF_FONT_WIDEOFFSETS )	{		for (i=0; i < nGlyphs; ++i)			SWFInput_getUInt32(input); // glyph offset		SWFInput_getUInt32(input); // code table offset	}	else	{		for(i=0; i < nGlyphs; ++i)			SWFInput_getUInt16(input); // glyph offset		SWFInput_getUInt16(input); // code table offset	}	font->shapes = (SWFShape *)malloc(nGlyphs * sizeof(SWFShape));	for(i = 0; i < nGlyphs; i++)		font->shapes[i] = readGlyphShape(input);	/* read glyph-to-code table */	if ( flags & SWF_FONT_WIDECODES )	{		for (i = 0; i < nGlyphs; ++i )			font->glyphToCode[i] = SWFInput_getUInt16(input);	}	else	{		for (i = 0; i < nGlyphs; ++i )			font->glyphToCode[i] = SWFInput_getChar(input);	}	if ( flags & SWF_FONT_HASLAYOUT )		readFontLayout(input, font);	SWFFont_buildReverseMapping(font);		return font;}/* pull font definition from fdb (font def block) file */SWFFont loadSWFFont_fromFdbFile(FILE *file){	SWFInput input;	SWFFont font;	if ( file == NULL )		return NULL;	input = newSWFInput_file(file);	font = loadSWFFontFromInput(input);	destroySWFInput(input);	return font;}#if 0/* retrieve glyph shape of a font */#include <stdio.h>#include <stdarg.h>/* basic IO */struct out{	char *buf, *ptr;	int len;};static void oprintf(struct out *op, const char *fmt, ...){	va_list ap;	char buf[256];	int d, l;		va_start(ap, fmt);	l = vsprintf(buf, fmt, ap);	while((d = op->ptr - op->buf) + l >= op->len-1)	{	op->buf = (char *) realloc(op->buf, op->len += 100);		op->ptr = op->buf + d;	}	for(d = 0 ; d < l ; d++)		*op->ptr++ = buf[d];}// return a malloc'ed string describing the glyph shapechar *SWFFont_getShape(SWFFont font, unsigned short c){	byte *p = SWFFont_findGlyph(font, c);	byte **f = &p;	struct out o;	int moveBits, x = 0, y = 0;	int straight, numBits;	int numFillBits, numLineBits;	int startX = 0;	int startY = 0;	int style;	o.len = 0;	o.ptr = o.buf = (char *)malloc(1);	*o.ptr = 0;	byteAlign();	if ( (numFillBits = readBitsP(f, 4)) != 1 ) /* fill bits */		SWF_error("SWFFont_getShape: bad file format (was expecting fill bits = 1)");	if ( (numLineBits = readBitsP(f, 4)) > 1 ) /* line bits */		SWF_error("SWFFont_getShape: bad file format (was expecting line bits = 0)");	/* now we get to parse the shape commands.	Oh boy.		 the first one will be a non-edge block- grab the moveto loc */	readBitsP(f, 2); /* type 0, newstyles */	style = readBitsP(f, 3);		if(readBitsP(f, 1))	{	moveBits = readBitsP(f, 5);		x = startX + readSBitsP(f, moveBits);		y = startY + readSBitsP(f, moveBits);		oprintf(&o, "moveto %d,%d\n", x, y);	}	else if(style == 0)	/* no style, no move => space character */		return o.buf;	if ( style & 1 )		if ( readBitsP(f, numFillBits) != 0 ) /* fill0 = 0 */			SWF_error("SWFFont_getShape: bad file format (was expecting fill0 = 0)");	if ( style & 2 )		if ( readBitsP(f, numFillBits) != 1 ) /* fill1 = 1 */			SWF_error("SWFFont_getShape: bad file format (was expecting fill1 = 1)");	if ( style & 4 )		if ( readBitsP(f, numLineBits) != 0 ) /* line = 1 */			SWF_error("SWFFont_getShape: bad file format (was expecting line = 0)");	/* translate the glyph's shape records into drawing commands */	for ( ;; )	{		if ( readBitsP(f, 1) == 0 )		{			/* it's a moveTo or a shape end */			if ( readBitsP(f, 5) == 0 )				break;			moveBits = readBitsP(f, 5);			x = startX + readSBitsP(f, moveBits);			y = startY + readSBitsP(f, moveBits);			oprintf(&o, "moveto %d,%d\n", x, y);			continue;		}		straight = readBitsP(f, 1);		numBits = readBitsP(f, 4)+2;		if ( straight==1 )		{			if ( readBitsP(f, 1) ) /* general line */			{				x += readSBitsP(f, numBits);				y += readSBitsP(f, numBits);			}			else			{				if ( readBitsP(f, 1) ) /* vert = 1 */					y += readSBitsP(f, numBits);				else					x += readSBitsP(f, numBits);			}			oprintf(&o, "lineto %d,%d\n", x, y);		}		else		{			int controlX = readSBitsP(f, numBits);			int controlY = readSBitsP(f, numBits);			int anchorX = readSBitsP(f, numBits);			int anchorY = readSBitsP(f, numBits);			oprintf(&o, "curveto %d,%d %d,%d\n",				 x+controlX, y+controlY,				 x+controlX+anchorX, y+controlY+anchorY);			x += controlX + anchorX;			y += controlY + anchorY;		}	}	*o.ptr = 0;	return o.buf;}#endif

?? 快捷鍵說明

復制代碼 Ctrl + C
搜索代碼 Ctrl + F
全屏模式 F11
切換主題 Ctrl + Shift + D
顯示快捷鍵 ?
增大字號 Ctrl + =
減小字號 Ctrl + -
亚洲欧美第一页_禁久久精品乱码_粉嫩av一区二区三区免费野_久草精品视频
另类小说视频一区二区| jlzzjlzz亚洲女人18| av电影在线观看一区| 337p亚洲精品色噜噜狠狠| 最新日韩在线视频| 精品一区中文字幕| 欧美日韩免费电影| 亚洲欧洲日韩综合一区二区| 免费av成人在线| 欧美三级日本三级少妇99| 国产人久久人人人人爽| 美女一区二区在线观看| 欧美在线色视频| 亚洲色欲色欲www| 国产电影精品久久禁18| 日韩欧美的一区| 天堂av在线一区| 在线国产电影不卡| ...av二区三区久久精品| 精品一区二区在线观看| 欧美一区二区大片| 免费成人在线影院| 日韩精品一区二区三区视频播放| 婷婷丁香久久五月婷婷| 在线影视一区二区三区| 亚洲乱码中文字幕| 99久久婷婷国产综合精品电影| 国产视频亚洲色图| 国产福利一区在线| 国产亚洲欧美中文| 国产成人精品网址| 国产精品天干天干在观线| 高清不卡一区二区| 欧美国产日韩亚洲一区| 成人国产一区二区三区精品| 欧美激情一区在线| 欧美日韩dvd在线观看| 亚洲一二三级电影| 91麻豆精品国产91久久久资源速度 | 欧美日韩国产天堂| 亚洲高清免费视频| 欧美福利电影网| 久久国产生活片100| 日韩免费观看2025年上映的电影| 六月丁香婷婷色狠狠久久| 精品久久一区二区三区| 国产成人鲁色资源国产91色综 | 91精品国产综合久久精品图片 | 久久成人免费日本黄色| 国产夜色精品一区二区av| 成人a区在线观看| 亚洲欧美国产高清| 欧美在线看片a免费观看| 天天综合天天综合色| 日韩欧美自拍偷拍| 丁香另类激情小说| 亚洲成人综合视频| 26uuu久久天堂性欧美| av午夜精品一区二区三区| 亚洲国产另类精品专区| 精品久久久久久久久久久院品网 | 国产一区二区在线免费观看| av不卡免费在线观看| 中文字幕高清不卡| 国产麻豆精品在线| 欧美在线观看视频一区二区三区| 日韩欧美国产精品一区| 亚洲欧美日韩久久精品| 粉嫩av亚洲一区二区图片| 欧美性感一区二区三区| 亚洲三级电影全部在线观看高清| 亚洲美女少妇撒尿| 日韩精品一级中文字幕精品视频免费观看 | 亚洲精品视频在线观看网站| 蜜臀av一级做a爰片久久| 蜜臀久久99精品久久久久久9| 国产91富婆露脸刺激对白| 中文字幕av免费专区久久| 日本免费新一区视频| 99精品1区2区| 日韩一区二区免费高清| 亚洲国产日韩在线一区模特| 成人avav在线| 同产精品九九九| 日本大胆欧美人术艺术动态| 欧洲在线/亚洲| 亚洲综合免费观看高清完整版 | 欧美色图激情小说| 国产精品一区二区三区乱码| 亚洲成人免费影院| 日韩久久一区二区| 2021国产精品久久精品| 欧美三级日本三级少妇99| 91丝袜美腿高跟国产极品老师 | 91亚洲大成网污www| 国产在线视频一区二区三区| 丝袜亚洲精品中文字幕一区| 亚洲女与黑人做爰| 国产精品乱人伦一区二区| 精品av综合导航| 日韩精品一区二区三区在线播放| 欧洲精品中文字幕| 91视频国产资源| 成人av电影在线观看| 成人福利视频网站| 成人自拍视频在线观看| 国产一区二区三区av电影| 狂野欧美性猛交blacked| 日本不卡视频一二三区| 天堂成人免费av电影一区| 五月天激情小说综合| 午夜亚洲福利老司机| 亚洲第一二三四区| 天堂蜜桃91精品| 热久久一区二区| 麻豆精品一区二区三区| 日本中文在线一区| 精品中文字幕一区二区小辣椒 | 9久草视频在线视频精品| 成人黄色片在线观看| 91在线视频免费观看| 日本高清成人免费播放| 在线观看欧美日本| 欧美视频中文字幕| 欧美日韩在线综合| 欧美日韩一二三区| 欧美成人艳星乳罩| 久久久久久久久久久久久久久99| 久久久久久久久久久久电影 | 精品国产乱子伦一区| 2022国产精品视频| 中文字幕国产精品一区二区| 综合欧美一区二区三区| 亚洲综合久久av| 美腿丝袜亚洲一区| 成人免费黄色大片| 在线观看国产日韩| 日韩欧美成人激情| 国产精品丝袜一区| 亚洲一区二区免费视频| 免费的国产精品| 99久久精品情趣| 欧美三级韩国三级日本三斤| 欧美zozo另类异族| 亚洲日本在线天堂| 美国av一区二区| 99国产精品视频免费观看| 欧美日韩国产精品自在自线| 欧美精品一区二区蜜臀亚洲| 亚洲欧洲美洲综合色网| 天天做天天摸天天爽国产一区| 国产精品综合一区二区| 色婷婷av一区二区| 精品国产91乱码一区二区三区| 欧美极品少妇xxxxⅹ高跟鞋 | 亚洲人成小说网站色在线| 日韩激情一区二区| 99视频精品在线| 日韩一级高清毛片| 亚洲三级免费电影| 国产精品一区二区91| 在线观看不卡一区| 国产欧美日韩在线视频| 午夜精品久久久久久久久久久 | 一区二区三区中文字幕精品精品| 午夜精品123| 91视频免费观看| 国产欧美日韩综合| 蜜桃视频在线观看一区| 在线视频一区二区免费| 欧美国产精品一区二区三区| 日韩高清不卡在线| 色哟哟日韩精品| 中文字幕欧美三区| 国产激情一区二区三区| 欧美一区二区在线免费观看| 亚洲女人的天堂| 成人午夜碰碰视频| 久久综合久久鬼色中文字| 日韩专区中文字幕一区二区| 91丨porny丨蝌蚪视频| 国产免费成人在线视频| 久久激情五月婷婷| 69堂亚洲精品首页| 亚洲福利视频导航| 在线观看日韩电影| 一区二区三区中文字幕| 97精品久久久久中文字幕| 欧美国产欧美亚州国产日韩mv天天看完整 | 国产亚洲精品福利| 国产在线视频一区二区| 精品电影一区二区| 久久99精品国产91久久来源| 日韩一区二区三区观看| 石原莉奈在线亚洲二区| 在线不卡的av| 丝袜美腿亚洲一区二区图片| 欧美色网站导航| 亚洲国产aⅴ成人精品无吗| 欧美色图在线观看|