示例#1
0
文件: gdraw.c 项目: awesome/fontforge
int GDrawPixelsToPoints(GWindow gw,int pixels) {
    if ( gw==NULL ) {
	if ( screen_display==NULL )
return( PixelToPoint(pixels,100));
	gw = screen_display->groot;
    }
return( PixelToPoint(pixels,gw->display->res));
}
示例#2
0
int GraphicsMisc::GetFontNameAndPointSize(HFONT hFont, CString& sFaceName)
{
	if (!hFont)
	{
		sFaceName.Empty();
		return 0;
	}
	
	LOGFONT lf = { 0 };
	::GetObject(hFont, sizeof(lf), &lf);
	
	sFaceName = lf.lfFaceName;

	return PixelToPoint(lf.lfHeight);
}
示例#3
0
FontInstance *GDrawInstanciateFont(GWindow gw, FontRequest *rq) {
    struct font_instance *fi;

    if (gw == NULL)
	gw = GDrawGetRoot(NULL);

    if ( rq->point_size<0 )	/* It's in pixels, not points, convert to points */
	rq->point_size = PixelToPoint(-rq->point_size, ((GXWindow) gw)->display->res);

    fi = xcalloc(1,sizeof(struct font_instance));
    fi->rq = *rq;
    fi->rq.family_name = x_u32_strdup_or_null( fi->rq.family_name );
    fi->rq.utf8_family_name = xstrdup_or_null( fi->rq.utf8_family_name );

return( fi );
}
示例#4
0
int GraphicsMisc::GetFontPointSize(HFONT hFont)
{
	return PixelToPoint(GetFontPixelSize(hFont));
}
示例#5
0
bool CCollision::PixelToPoint(CMapObject *MapObj, long X, long Y)
{
	return PixelToPoint(MapObj, X, Y, 0);
}