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)); }
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); }
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 ); }
int GraphicsMisc::GetFontPointSize(HFONT hFont) { return PixelToPoint(GetFontPixelSize(hFont)); }
bool CCollision::PixelToPoint(CMapObject *MapObj, long X, long Y) { return PixelToPoint(MapObj, X, Y, 0); }