Q&A - Question

Changing Label Font Size for a Layer - Labels Disappearing

Question
ScoL asked on November 07, 2019, keyword: Developer Kernel

We have figured out how to change the label and label shadow colors for a layer. Now I am trying to adjust the font size larger and smaller, but when I do this, the labels disappear instead of changing in size, and they won't come back.

Below is my function, which we want to call for multiple symbol layers in our map. What am I doing wrong? Is there a better way to do this? The config file has these labels at 8 point font. We want to adjust from 6 to 20 points depending on user preference.

Thank you,

Scott

procedure SetLayerLabelColors(L : TGIS_LayerVector);
var
  P : TGIS_ParamsSectionVector;
begin
  // Change parameters for each layer
  if (L.ParamsList.Count > 0) then begin
    if (L.ParamsList[0] is TGIS_ParamsSectionVector) then begin
      P := TGIS_ParamsSectionVector(L.ParamsList[0]);

      // Colors are of type TGIS_Color
      // I am able to change the font colors at run time, no problems
      P.Labels.Color := cSymbolLabelShadowColor;
      P.Labels.FontColor := cSymbolLabelColor;

      // If I uncomment this line and change the font size at runtime, my labels disappear
      // P.Labels.FontSize := iFontSize;
    end;
  end;
end;

Answers
ScoL replied November 02, 2019
Well, I figured it out. It now works.
Anyone know how to adjust the shadow thickness?

P.Labels.Font.Size := iFontSize;


 
Tomasz Kosinski (TatukGIS) replied November 07, 2019

You can only tin showno on/off (if label Color is same as font color, then show is off.

 

Take a also a look on: FontSizeAsText and: AsText syntax

If you would like to answer the question please Sign In.
*
*
Please review our recent Privacy Policy.
If you have any questions or requests, please contact us.
Rules
The Questions and Answers (Q & A) is intended to provide a means of communication between TatukGIS customers.
 
  1. Licensed users (with active maintenance play) of TatukGIS products may contribute to the Q & A content. Read-only access is available to anyone.
  2. Keep the content positive and professional.
  3. Be courteous to others by posting information when a question or issue asked on the Q & A is answered or resolved by other means (such as with help from TatukGIS technical support). Offer others at least a hint how the posted question was answered or the issue was resolved.
  4. The Q & A is not a replacement for TatukGIS technical support. TatukGIS team may or may not regularly follow or contribute content.