Jump to content

'Draw Text' bad font anti aliasing


Recommended Posts

Hi,

 

I just attempted to use LabVIEW (2014) to make a few custom JPEGs - the customization being definition of image background color and adding some text.

 

Then I realized that the 'Draw Text at Point.vi' and relatives really does a bad job at font anti aliasing. Comparison with a simple graphics editor (zoomed in view of a very large capital G):

 

LabVIEW 'Draw Text at Point.vi':

post-15239-0-09667100-1432300776.png

 

Paint.Net:

post-15239-0-71112500-1432300803.png

 

And yes, this is very noticable even for smaller text sizes.

 

Question: Has anybody made any good graphics creation toolkits for LabVIEW, or do I have to live with these built-in anti aliasing algorithms from 1990?

 

Bonus question: How on earth does those image VIs font point size correlate to the font size in non-LabVIEW image editors? In Paint.Net I used font size 216, while I had to use 350pt for font size with 'Draw Text at Point.vi'. In Paint.Net the image was 96 PPI, and I reckon LV does 72 DPI only (Windows 7 was set at 96 DPI with 100% scaling). So I would've expected to set the user defined font for 'Draw Text at Point.vi' at 288pt (216 * 96/72) to get the same size letter, but I had to go up to 350pt in LabVIEW to match 216pt in Paint.Net. What gives?

 

Cheers,

Steen

Edited by Steen Schmidt
Link to comment

Yeah, as someone who has used the picture primitives a lot, all I can say is I feel your pain with regards to quality.

The bitman library is fantastic but won't help with text.

As for size, LabVIEW uses the size as the pixel height of the line. So three lines of size 15 text occupy a bounding box 45 pixels high (assuming no rotation). That doesn't mean the text is 15 pixels on each line though, the exact dimensions of that are determined by the font.

Link to comment

Bonus question: How on earth does those image VIs font point size correlate to the font size in non-LabVIEW image editors? In Paint.Net I used font size 216, while I had to use 350pt for font size with 'Draw Text at Point.vi'. In Paint.Net the image was 96 PPI, and I reckon LV does 72 DPI only (Windows 7 was set at 96 DPI with 100% scaling). So I would've expected to set the user defined font for 'Draw Text at Point.vi' at 288pt (216 * 96/72) to get the same size letter, but I had to go up to 350pt in LabVIEW to match 216pt in Paint.Net. What gives?

 

Please vote for this idea: http://forums.ni.com/t5/LabVIEW-Idea-Exchange/Font-size-standardization/idi-p/1405022

 

Someone made a tool to compensate for this issue (I haven't used it myself though): https://decibel.ni.com/content/groups/ui/blog/2013/06/07/font-sizes-in-labview--conversion-utility-vi

Edited by JKSH
Link to comment

You're right, the aliasing happens in the 'Picture to Pixmap.vi' but since texturing involves scaling and filtering the result looks slightly better than just using 2D with a big font size. You can then call "Render To Image" and save the result as JPEG.

Link to comment

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Paste as plain text instead

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.

×
×
  • Create New...

Important Information

By using this site, you agree to our Terms of Use.