05-23-2020 05:26 PM
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?
05-24-2020 12:40 AM
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).
05-25-2020 05:19 AM
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?
05-25-2020 09:28 AM
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.
05-25-2020 11:38 AM
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 👍
05-26-2020 01:05 AM
If the feature is considered important, I would also look at other options. For example:
With that much work, I expect that you're right that disabling the option is the easiest.