<p dir="ltr">Den 20 okt. 2016 5:30 em skrev "David Lonie" <<a href="mailto:david.lonie@kitware.com">david.lonie@kitware.com</a>>:<br>
><br>
> On Thu, Oct 20, 2016 at 11:27 AM, Elvis Stansvik <<a href="mailto:elvis.stansvik@orexplore.com">elvis.stansvik@orexplore.com</a>> wrote:<br>
>><br>
>> Using built-in fonts I also get text rendered smaller than expected.<br>
>><br>
>> However, I think it's a matter of DPI. I guess VTK assumes a DPI of 72<br>
>> somewhere?<br>
>><br>
>> With the following, the text is rendered in the expected size:<br>
>><br>
>>     auto logicalDpiY = QApplication::screens().at(0)->logicalDotsPerInchY();<br>
>>     ...<br>
>>     textProperty->SetFontSize(qRound(10 * (logicalDpiY / 72.0)));<br>
>>     textProperty->SetFontFamilyAsString("Noto Sans");<br>
>><br>
>> So I'm compensating for VTK's assumption about 72 DPI by increasing<br>
>> the font size (on my system Qt's logicalDotsPerInchY() reports<br>
>> 96.2526).<br>
>><br>
>> I guess I should also figure out how to be notified when the widget is<br>
>> moved to another screen and update the size, since the DPI of the<br>
>> other screen might be different.<br>
><br>
><br>
> Aha, yes, VTK does assume 72 DPI by default. We very recently added the ability to change that for text rendering purposes. Call vtkRenderWindow::SetDPI to update it to what Qt is using, and the text rendering should adjust accordingly. Let me know if that fixes it.</p>
<p dir="ltr">Aha, thanks for the tip. On my way home now but will test tomorrow. Do you know if it's in 7.1rc1? I'm building my Debian package from that tag </p>
<p dir="ltr">Elvis</p>
<p dir="ltr">><br>
> Dave <br></p>