LabVIEW

cancel
Showing results for 
Search instead for 
Did you mean: 

Draw Text in Rect Outline?

Hello,

 

Has anyone tried using Outline? input of Draw Text in Rect function? I select User-Specified Font and I have been trying to choose Outline? input, but it does not make any difference. Also Shadow? does not make difference.

 

I have tried different fonts, but this two inputs did not work for me, does anyone know what can be reason?

 

0 Kudos
Message 1 of 6
(2,389 Views)

I haven't tried, but I assume the picture control uses the same code to render the text as is used in LV itself, and the documentation for that says that these options only work on Macs (see section 7) - https://zone.ni.com/reference/en-XX/help/371361R-01/lvhowto/changing_text_settings/

 


Select how you want the text to appear by placing or removing checkmarks from the Plain, Bold, Italic, Underline, Strikeout, (macOS) Outline, and (macOS) Shadow checkboxes.

If you really do want to show outlined text, you could probably insert it into the picture yourself as an image, although then you will have less freedom with the font sizes (assuming you're not building the text yourself on a pixel level, but using an image of an existing font).


___________________
Try to take over the world!
Message 2 of 6
(2,327 Views)

I guess so, because these are the only ones that does not work on Windows, as described in the help file.

 

In the application I am developing, user is adding completely custom texts on the picture. I can limit the font and size options to a couple of options, but the text itself can be anything. I am not sure if I understand your advise correctly. What do you mean is, I can draw an extra rectangle based on the text size, or something else?

0 Kudos
Message 3 of 6
(2,283 Views)

I meant that rather than using the text functions, you get an image of a font with an outline and place the relevant images in the picture control based on the text the user selects. You will need an image for each character that the user will be able to use and for each font size (assuming you don't want to start rescaling in code), that is, an image of an A, of a B, of an a, and so on.


___________________
Try to take over the world!
Message 4 of 6
(2,272 Views)

I get it. Currently user can select hundreds of fonts and sizes. Even if I constraint with a couple of font and sizes, it will require a lot of work for each character + upper/lower case. Beside I have to limit font selection a lot. If I compare the additions of having the outline with losing a lot of font options + complexity of code and work to do, I prefer to disable outline selection.

 

Still thank you for your workaround suggestion 👍

0 Kudos
Message 5 of 6
(2,261 Views)

If the feature is considered important, I would also look at other options. For example:

 

  1. Using a .NET picture control and drawing everything in there.
  2. Embedding a web browser with an HTML5 canvas and drawing everything there.
  3. Interacting dynamically with another program to generate the text images on the fly (maybe Inkscape? I'm not sure which program would be relevant for being able to render fonts, allow you to get their images and be convenient for programmatic access).

With that much work, I expect that you're right that disabling the option is the easiest.


___________________
Try to take over the world!
Message 6 of 6
(2,237 Views)