AutoCAD Map 3D General Discussion

Reply
Distinguished Contributor
annw2
Posts: 1,263
Registered: ‎03-07-2006
Message 1 of 4 (155 Views)
Accepted Solution

two fonts and two font sizes in label

155 Views, 3 Replies
06-09-2014 07:03 AM

Again as I stumble through this process, I am starting to figure out how to label the tax parcels with owner name, Tax ID codes, etc.

 

Our standard is to have the "N/F name" in a larger font & the remaining information in a different font and smaller size.

 

As far as I can see, I need to use the concat function for one long chain and I can't see any provisions for changing font half way through or adding a second concat function at a different size.

 

The help function leaves a lot to be desired.

 

Now that I have it working, how do I put this function into my template or block it from one drawing to another?

Ann Wingert, P.E.
Product Support
diane.cloutier
Posts: 46
Registered: ‎01-16-2014
Message 2 of 4 (120 Views)

Re: two fonts and two font sizes in label

06-12-2014 01:52 PM in reply to: annw2

Hi Ann,

 

As far as I can tell, there is no way to use more than one font type/size in a label.  I am going to research this a little further though to confirm this or see if there is some sort of workaround.  

 

You also wanted to know how to apply label settings to other drawings.  You can accomplish this by saving a layer file (the resulting file will have the extension .layer) and then loading the layer into a new drawing.  

 

To save a layer:

1) In the Display Manager, right-click the layer > Save Layer

 

To load a layer:

1) In the Display Manager, click Data > Load Layer

 

If you just want to save the label expression for future use, you can Save/Load Expressions via the Options button on the Create/Modify Expressions diaglogue box.

 

SaveLoadExpressions.png

 

Please let me know if that helps.

 

Thanks,



Diane Cloutier
Product Support
diane.cloutier
Posts: 46
Registered: ‎01-16-2014
Message 3 of 4 (92 Views)

Re: two fonts and two font sizes in label

06-19-2014 12:22 PM in reply to: diane.cloutier

Hi Ann,

 

Thank you for your patience while I researched your question about using two different font styles/sizes in a GIS polygon label. It turns out that you can do this with an MTEXT label and format codes. This method is pretty straight forward if you are using static text, but if you are using an expression (as you likely would be with parcel labels), there is a known issue with the '|' character (the style editor wraps the expression string in double quotes and causes incorrect evaluation of the expression) but there is a workaround.  Here are instructions/examples for both static text and the expression workaround:

 

Static Text:

 

1)When you add the feature label, make sure you choose the MTEXT symbol:

MtextLabel.png

 

2) Then in your label text content add the control code you need.

 

Here are some examples:

 

Example 1 – two fonts

“\fArial|b0|i0;Arial\P\fTimes New Roman|i1|b1;Times New Roman”

Ex1.png

 

Example 2 – fonts / colors, underline / overline

“Black \C3;Green \P\C0;\fTimes New Roman|i1|b1; Times New Roman Italics Bold \P\fArial|i0|b0;\LUnderlined\l \OOverlined\o”

Ex2.png

 

 

Expression Workaround:  


1) Create a layer with the label and give it the desired expression.  At this point it won’t yet render correctly because it has the extra quotes.  You can actually see this in the style editor:

Expression.png

 

2) Save the layer as a .layer file

 

3) Open the layer file in a text editor, and search for the expression. It should be part of a ParameterValue element. In my case I had the following:

<ParameterValue>"CONCAT('\fArial|b0|i0;Area: ', AREANAME, '\P\fTimes New Roman|i1|b1;State: ', ST)"</ParameterValue>

 

4) Remove the extra quotes surrounding the expression, and save the .layer file

<ParameterValue>CONCAT('\fArial|b0|i0;Area: ', AREANAME, '\P\fTimes New Roman|i1|b1;State: ', ST)</ParameterValue>

 

5) Drop the modified layer into Map’s Display Manager – the labels now display correctly:

ExpressionSample.png

 

Note – as soon as you use Map’s Style Editor to make a change to the label it will once again add the extra quotes.

 

This issue with the '|' character has been logged with our development team as a change request.

 

Also, here are some links to format code references:

 

http://docs.autodesk.com/ACD/2014/ENU/index.html?url=files/GUID-7D8BB40F-5C4E-4AE5-BD75-9ED7112E5967...

 

http://www.cadforum.cz/cadforum_en/text-formatting-codes-in-mtext-objects-tip8640

 

Hope that helps.

 

Thanks!

Diane



Diane Cloutier
Product Support
diane.cloutier
Posts: 46
Registered: ‎01-16-2014
Message 4 of 4 (89 Views)

Re: two fonts and two font sizes in label

06-19-2014 12:33 PM in reply to: diane.cloutier

One more thing to add...

 

The reference links I included are both missing the format codes for font (lower case 'f') and true color (lower case 'c'):

 

\ffont[|b#][|i#][|p#][|cN]; TrueType font override.

Example: \fArial|b0|i0|p34|c0;

  font: TrueType face name

  b#, where # is 0 or 1 for bold off/on; optional

  i#, where # is 0 or 1 for italic off/on; optional

  p#, where # is Windows LOGFONT Pitch and Family parameter; optional

  c#, where # is Windows LOGFONT character set parameter; optional

 

\c#; - True color in decimal, where # is 0 to 16777215 Decimal BGR color (Blue << 16) | (Green << 8) | (Red);

Example: \c16744192;

 

I have also logged a request to update this in the Help file (as well as those from the CADforum site that are missing).

 

Thanks,



Diane Cloutier

You are not logged in.

Log into access your profile, ask and answer questions, share ideas and more. Haven't signed up yet? Register

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.

Need installation help?

Start with some of our most frequented solutions to get help installing your software.

Ask the Community