Qt 4.8
Functions
qfont_mac.cpp File Reference
#include "qfont.h"
#include "qfont_p.h"
#include "qfontengine_p.h"
#include "qfontengine_mac_p.h"
#include "qfontengine_coretext_p.h"
#include "qfontinfo.h"
#include "qfontmetrics.h"
#include "qpaintdevice.h"
#include "qstring.h"
#include <private/qt_mac_p.h>
#include <private/qtextengine_p.h>
#include <private/qunicodetables_p.h>
#include <qapplication.h>
#include "qfontdatabase.h"
#include <qpainter.h>
#include "qtextengine_p.h"
#include <stdlib.h>

Go to the source code of this file.

Functions

float qt_mac_defaultDpi_x ()
 
int qt_mac_pixelsize (const QFontDef &def, int dpi)
 
int qt_mac_pointsize (const QFontDef &def, int dpi)
 

Function Documentation

◆ qt_mac_defaultDpi_x()

float qt_mac_defaultDpi_x ( )
Warning
This function is not part of the public interface.

Definition at line 61 of file qpaintdevice_mac.cpp.

Referenced by QMacPixmapData::metric(), QWidget::metric(), qt_defaultDpiX(), qt_mac_pixelsize(), and qt_mac_pointsize().

62 {
63  // Mac OS X currently assumes things to be 72 dpi.
64  // (see http://developer.apple.com/releasenotes/GraphicsImaging/RN-ResolutionIndependentUI/)
65  // This may need to be re-worked as we go further in the resolution-independence stuff.
66  return 72;
67 }

◆ qt_mac_pixelsize()

int qt_mac_pixelsize ( const QFontDef def,
int  dpi 
)

Definition at line 64 of file qfont_mac.cpp.

Referenced by QFontDatabase::load().

65 {
66  float ret;
67  if(def.pixelSize == -1)
68  ret = def.pointSize * dpi / qt_mac_defaultDpi_x();
69  else
70  ret = def.pixelSize;
71  return qRound(ret);
72 }
qreal pointSize
Definition: qfont_p.h:89
float qt_mac_defaultDpi_x()
qreal pixelSize
Definition: qfont_p.h:90
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203

◆ qt_mac_pointsize()

int qt_mac_pointsize ( const QFontDef def,
int  dpi 
)

Definition at line 73 of file qfont_mac.cpp.

Referenced by QFontDatabase::load().

74 {
75  float ret;
76  if(def.pointSize < 0)
77  ret = def.pixelSize * qt_mac_defaultDpi_x() / float(dpi);
78  else
79  ret = def.pointSize;
80  return qRound(ret);
81 }
qreal pointSize
Definition: qfont_p.h:89
float qt_mac_defaultDpi_x()
qreal pixelSize
Definition: qfont_p.h:90
Q_DECL_CONSTEXPR int qRound(qreal d)
Definition: qglobal.h:1203