示例#1
0
文件: D3dFont.cpp 项目: NyouB/4t4c
void FontInstance::SetFontSize(int NewSize)
{
	ScopedLock Sl(Lock);
	//FT_Set_Char_Size( Face, 0, NewSize*64, 0, 0);
	FT_Set_Pixel_Sizes(Face, 0 , NewSize);
	PixelMetrics=Face->units_per_EM;
};
示例#2
0
文件: D3dFont.cpp 项目: NyouB/4t4c
void FontInstance::DrawFinal( QuadTexture* Surface,const int Px, const int Py,Utf32String& Str,const unsigned long Color,bool Gen)
{
	ScopedLock Sl(Lock);
	FT_Error Error;
	ScanLineUserInfo Info;
	FT_Glyph	AGlyphs[512];   /* glyph image    */
	FT_Vector   APos   [512];   /* glyph position */

	//get all glyph and compute rendering pos
	int PosX=0;
	int PosY=0; //Py+(Face->height>>6)/3;
	unsigned int GlyphArrIdx=0;
	for (unsigned int i=0;i<Str.size();i++)
	{
		//retrieve the glyph with the UTF-32 code
		AGlyphs[GlyphArrIdx]=GetGlyph(Str[i]);

		if (AGlyphs[GlyphArrIdx]!=0)
		{
			/* store current pen position */
			APos[GlyphArrIdx].x = PosX;
			APos[GlyphArrIdx].y = PosY;

			//advance is in 16.16 fixed format
			PosX+=AGlyphs[GlyphArrIdx]->advance.x>>16;
			PosY+=AGlyphs[GlyphArrIdx]->advance.y>>16;

			GlyphArrIdx++;
		}
	}
示例#3
0
文件: D3dFont.cpp 项目: NyouB/4t4c
float FontInstance::GetHeight(void)
{
	ScopedLock Sl(Lock);
	FT_Size_Request Size;
	FT_Request_Size(Face,Size);
	return (float)Size->height/64.0f;
};
示例#4
0
// msg -- 
prim ATH_perror() {
    
    Sl(1);
    So(0);

    perror((char *)S0);
    errno=0;
    Pop;
}
示例#5
0
prim ATH_mmap() {
    void *ptr;
    Sl(2);
    So(1);
    
    
	ptr = mmap(0,S0, PROT_READ | PROT_WRITE, MAP_SHARED, S1, 0);
    Pop;
    S0=(stackitem)ptr;
}
示例#6
0
文件: D3dFont.cpp 项目: NyouB/4t4c
int FontInstance::GetLen(std::wstring& Text)
{
	ScopedLock Sl(Lock);
	float Length=0.0f;
	for (unsigned int i=0;i<Text.size();i++)
	{
		//retrieve the glyph with the UTF-32 code
		FT_Glyph Glyph=GetGlyph(Text[i]);
		Length+=(float)(Glyph->advance.x>>16);
		FT_Done_Glyph(Glyph);
	}
	return (int)Length;
};
示例#7
0
// file_descriptor size ---
prim ATH_shmSize() {
    off_t length;
    int shmFd;
    
    Sl(2);
    
    length = (off_t) S0;
    shmFd = (int)S1;
    
    /* configure the size of the shared memory segment */
	ftruncate(shmFd,length);
    Pop2;
}
	void SemiImplicitDiffusionAlgorithm::computeDiffusivity() 
	{
		double c1(0.), c2(0.);
		for (unsigned int i(1); i<m_Nx; ++i) 
		{
			for (unsigned int j(1); j<m_Ny; ++j) 
			{
				c1 = m_H->Staggered(i, j);
				c2 = staggeredGradSurfNorm(i, j, m_H);
				D(i, j) = (Gamma()*c1 + rhogn()*Sl(i, j)) * pow(c1, n() + 1)*pow(c2, n() - 1);
			}
		}
	}
示例#9
0
// name -- fd
prim ATH_shmOpen() {
    int shmFd;
    Sl(1);
    So(2);
    
    shmFd=shm_open( (char *)S0, O_CREAT | O_RDWR, 0600 );  // only the owners processes can access
    
    if(shmFd < 0) {
        S0 = true;
    } else {
        S0 = shmFd;
        Push=false ;
    }
}
示例#10
0
prim ATH_initRamBlocks() {
    int size;
    Sl(1);
    So(2);

    P_here();
    P_swap();

    size=S0 * 1024;
    S0=size;

    P_allot();

    memset((void *)S0, ' ', size);
}
示例#11
0
// <ptr> name -- ptr
prim ATH_getenv() {
    Sl(2); // On entry will use this many.
    So(1); // on exit will leave this many.

    char *name=(char *)S0;
    char *ptr=(char *)S1;
    char *tmp;

    Pop2;

    tmp = getenv(name);
    if(!tmp) {
        Push=-1;
    } else {
        strcpy(ptr, tmp);
        Push=(stackitem)ptr;
        Push=0;
    }
}
示例#12
0
文件: D3dFont.cpp 项目: NyouB/4t4c
FontInstance* FreeTypeMgr::InstanciateFont(std::wstring FontName, unsigned int FontSize)
{
	ScopedLock Sl(*this);

	std::wstring FontPath(FontDir);
	FontPath+=FontName;

	FT_Face Face=0;

	std::string Path2=Convert(FontPath);

	//Load font info from file
	if (FT_New_Face( Library, Path2.c_str(), 0, &Face )) 
		throw std::runtime_error("FT_New_Face failed (there is probably a problem with your font file)");

	//check the charmap
	//FT_Select_Charmap(Face,FT_ENCODING_UNICODE);

	FontInstance *Inst=new FontInstance(Library,Face);
	Inst->SetFontSize(FontSize);

	return Inst;
};
示例#13
0
int K1(int iRT, int zO_P, int Do, int vxlI, int j1i, int a, int JUdI, int X, int pOY) {
if (Bba - QJ0E >= + ! HL(- z(302957500, ! (k9j) != eJvv + (G((ShI * (dAd)), 2084374456, - (1394734516) - 578517423, 420911301)), (zqg)), xdqI, P, (rnkx(+ V2(2141821581, ! pSOs((10986324), - + XAO > E7 == N() <= Sl() / 264945842 >= TE + qV < (1458692725) % XYqq), - ! ! M, 1551887947, XnwB()), Tn(782235838 == uQZ > podo(1337746681, ! 224880727), ! eca < ZTyn, 484572022, + ! ! v4v))) >= - w8w5(290173308 * k5, 1725371014, 1216256323, o2DU) > 50666347 != SnrK) % KPt + dDQ3) ;
 else return K;
while (! 1985392826) return J2st(x23, 142371013);
return AJkU / 1202235129;
{
int lLU;
int S9;
int ZYL;
int SjH;
int Uor;
int nv;
int _JYO;
ceH_;
}
;
}