Ok,
I just thought that knowing capital letter height I can calculate correct
font pixel size but seems using font metrics and iteration over pixel sizes
is the only option. Thank you all for help!
czw., 18 paź 2018, 01:04 użytkownik Allan Sandfeld Jensen
napisał:
> On Donnerstag, 18. Oktober
On Donnerstag, 18. Oktober 2018 00:58:14 CEST Allan Sandfeld Jensen wrote:
> On Mittwoch, 17. Oktober 2018 22:11:38 CEST Tomasz Olszak wrote:
> > Ok,
> > It's a lot more clear. Thank you for explanation!
> >
> > I used default font with pixel size 100 and according to FontMetrics:
> > 1. family:
On Mittwoch, 17. Oktober 2018 22:11:38 CEST Tomasz Olszak wrote:
> Ok,
> It's a lot more clear. Thank you for explanation!
>
> I used default font with pixel size 100 and according to FontMetrics:
> 1. family: "Sans Serif"
> 2. pointSize: 75
> 3. pixelSize: 100
> 4. ascent 93
> 5. descent: 24
>
Ok,
It's a lot more clear. Thank you for explanation!
I used default font with pixel size 100 and according to FontMetrics:
1. family: "Sans Serif"
2. pointSize: 75
3. pixelSize: 100
4. ascent 93
5. descent: 24
6. height: 117
7. leading -1
So how ascent, descent, leading is related to 100. How
+1. Make sure that you are accounting for the full font height, see
QFontMetrics::ascent() and descent()
> Sent: Wednesday, October 17, 2018 at 1:23 PM
> From: "Allan Sandfeld Jensen"
> To: development@qt-project.org
> Subject: Re: [Development] Why on Linux using FreeType engine fonts are
>
On Mittwoch, 17. Oktober 2018 19:10:45 CEST Tomasz Olszak wrote:
> Could you please try example I sent on Linux and explain why font size
> doesn't match rectangle size? Maybe the ft font engine has bug?
>
Try putting a capital Å or any other capital with accents in your example, and
you will
Could you please try example I sent on Linux and explain why font size
doesn't match rectangle size? Maybe the ft font engine has bug?
śr., 17 paź 2018, 19:07 użytkownik Allan Sandfeld Jensen
napisał:
> Hi
>
> That is a incorrect assesment. Fonts are rendered in pixel sizes. When you
> request
Hi
That is a incorrect assesment. Fonts are rendered in pixel sizes. When you
request a QFont at a certain pixel size you get the font in that size. It
should be noted that those sizes ONLY matter for things like pixel hinting.
The font will typically be rendered in the same size it was
Sorry accidental Shift+Enter
https://pastebin.com/m2tAgT3f
For my screens QScreen::physicalDotsPerInch() return ~92dpi instead of
96 but it is probably due to some platform edid implementation or
something like that.
śr., 17 paź 2018 o 19:04 Tomasz Olszak napisał(a):
>
> Here you can find and
Here you can find and example of what I believe is true:
śr., 17 paź 2018 o 18:48 Tomasz Olszak napisał(a):
>
> If I understand correctly font.pixelSize is actually not the same as
> pixels user for with and height of items. So if you render rectangle
> of height e.g 100 pixels on 96 dpi screen,
If I understand correctly font.pixelSize is actually not the same as
pixels user for with and height of items. So if you render rectangle
of height e.g 100 pixels on 96 dpi screen, and render Text with
font.pixelSize = 100 on 96 screen the iheight of text will be exactly
100 * 72/96 which is
A pixel is a pixel, regardless of DPI.
However things matter when you use point sizes (which assumes 72 points per
inch) there are also Screen.devicePixelRatio (
http://doc.qt.io/qt-5/qml-qtquick-window-screen.html#devicePixelRatio-attached-prop
) to contend with. I haven't had to worry about
Hi,
I would like just to ensure that I missed something and there is
documentation somewhere informing that Linux fonts are rendered
*always* in 72 dpi
(https://www.freetype.org/freetype2/docs/reference/ft2-base_interface.html#FT_Set_Char_Size)
(which makes font.pixelSize inaccurate for regular
13 matches
Mail list logo