News:

The purpose of these forums is to discuss TurboCAD.  Please keep the discussion of other products to compatibility issues or how the other software can be used with TurboCAD.

Main Menu
TurboCAD 2026 Platinum box
Now available

TurboCAD 2026.2

The latest update for TurboCAD 2026. It installs over any 2026 build and keeps your activation, drawings and settings. Get it from the Start Page or Help > Check for Update.

Mix large and small caps within individual words

Started by LabeK, July 27, 2021, 09:41:54 AM

Previous topic - Next topic

0 Members and 0 Guests are viewing this topic.

LabeK

I'm doing a shop drawing that will show the font layout for lettering we carve on limestone benches. The font (Optima Nova Titling) we use for this client only has upper case letters, and this has not been a problem in the past.  Now they want to mix large and small caps within a given word; for example, ANN would have a large cap "A" and two small cap "N"s.  I've tried exploding the text twice, editing the reference point to a lower corner and scaling the "N"s to 75%.  This sort of works, but I need reposition the spacing to look right, which consumes a lot of time - also, the letters are no longer text.  I've tried editing the text in properties and selection info to no avail.  Do I need to create this text on an outside program and import it, or can this be done in TurboCad?  I use 2021.1 Platinum 64 bit.

Andy H

Would Multitext be any good.  in Multitext one can change the font size of individual letters.  So one can have large and small capitals, in the same word.  The drawback is that lower font sizes obviously means the characters look narrow and the large font looks bolder.

LabeK

Andy H.:  I tried using multi-text earlier with no luck, but tried it again, and I think I can make it work.  I'll need to mess around with the kerning of the letters to make the spacing look right.  Thanks!

Alvin Gregorio

How many words, and more importantly, characters, are we talking about on this project?
Can you give us the full sample verbiage that will be on the bench(es)?
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

#4
I Exploded it; then moved the characters, which are now Groups, around.

I figured:
>Fonts are art; so with that in mind, I have leeway as to how I do my art, for something like engraving on a limestone bench.
>I guessed that the engraving or the template used for the engraving would be done with CNC; so convert to Polylines, then saved as .dxf, would be required anyway.  The Groups would have to be Exploded one more time to accomplish that.
_____
Another way I thought about going about it:  Making first character of each word its own individual Text; making the remaining characters of each word its own individual Text, it being about ¾ of the size of the larger, first characters.  Problem was that I couldn't use the Align tool to precisely align the bottoms.
_____
Change the Font extension from .txt to .ttf if someone wants to install it.  I changed it for allowance of uploading here.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

If we want/need it to remain Text object(s):

We can set the Text mode to Flexible.  Then relocate the Reference Point for each, the first/larger letter of a word and the following characters of the word, that Reference Point location being the lowest of that set of character(s).  Then move them, snapping to a Line or Grid.  After we get it all as we like it, change the Text mode back to Standard or Scalable.

That's what I did in the middle line of Text in the screen capture and file below.

I copied combined word characters that I already spaced when there was another instance of that same word.  Such as THE.  For uniformity.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

#6
You Don't say which version you are using.
If you are using a platinum version I have a simple PPM Example that you can Modify to suit your needs.
Word art - Using a script in the macro recorder is very easy too
Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

LabeK

Nikki P.:  I'm using TC 2021 Platinum.  I'm not familiar with the acronym "PPM".  That and using the macro recorder sounds interesting, but I would need more info on how they work.

Alvin G.:   Regarding - [Can you give us the full sample verbiage that will be on the bench(es)?]  I need to respect the client's privacy, but your Brown Fox examples are close enough.
      Regarding - [I guessed that the engraving or the template used for the engraving would be done with CNC]  Actually, we paste a full size paper copy over the stone and handcarve the characters with chisel and mallet (or air hammer) through the paper.  You are correct that I don't need to keep the letters in TEXT mode, although I like to print them in FLEXIBLE view - less ink and I can see the carve line.
      Regarding your other fixes:  alignment is always a problem for me when using font, because they don't have crisp points to reference and snap to.  For my application (handcarving), the alignment does not need to be "perfect", but the spacing and line need to look "right" to the eye.  Your .tcw #4 is well done, but you'll notice that the "J" is supposed to hang down below the line; that is why I prefer to use a method where I don't need to adjust the "y" axis.  For me, it's easier to mess with the "x" axis to open up or close the spacing, which means it is best for the characters to be individual, as in MULTITEXT.

Thank you all for your ideas.  I'll try some of them this afternoon.

Alvin Gregorio

Yeah, MultiText is the way to go.  Of course.  I don't know what I was thinking last night; must have been tired from framing in +100°F heat all day and brain-faded.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

#9
How do you change the spacing between letters with Multi Line Text?
The Macro method would be the same as Alvins First Method except the computer does the spacing.
Multiline text works  - But It is a pain to change letter sizes.
The attached was done using the Macro Recorder. And Alvins Drawing- Because I don't have the font

Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

LabeK

#10
Good point Nikki.  I select all the ones that need to eventually move to the right and successively move them to get the spacing I want - very tedious!  I'll take a look at the Macro Recorder to see if I can figure it out.

Question for Alvin:  what steps did you take?  Did you enter all the letters in multitext at 1", and then scale to .75"  the letters, other than the first letter in each word?  When I do that, the space between the first and successive letters is too far apart, and needs to be moved. 

What I don't like about multitext:  you have to create a text window size to start the operation.  Normally, I snap the cursor to the center of extents, and set the text to be middle - middle justification.  I don't normally know the width of the total text, so I'm having to reposition a text window that I can't center easily.

Alvin Gregorio

#11
Quote from: LabeK on July 28, 2021, 09:33:52 AM
Question for Alvin:  what steps did you take?  Did you enter all the letters in multitext at 1", and then scale to .75"  the letters, other than the first letter in each word?  When I do that, the space between the first and successive letters is too far apart, and needs to be moved. 

Yes, that is what I did.  Used the left & right keyboard arrow keys to move about, and those keys in combination with holding the Shift key down to select the characters I wanted to be .75".  I did not include in that selection the space between words; but I guess if you wanted the space to be smaller, you could include it with the highlighting-selection of the other to-be .75" characters.
___
I think my results look good.  I guess its sort of artistic interpretation, what you do.  Yours and the customer's interpretation.  If I were the engraving designer or the customer, I'd be satisfied with how mine looked.
___
Note too that I have "Text box height" set as the option for this drawing's Space Units' "Text height specified by:".  "Character height above the font base line" might suit your uses better.
___________________________
I don't understand why it's imperative to make this so easy-peasy.  It's presumably a one-off.  Or at most a two-off.  I mean, how many customers insist on what this customer is wanting (Optima Nova Titling font, but not what the original or succedent designers designed-- smaller-caps when not using Shift/Cap key on the keyboard).  And how many different possible phrases or lines of poetry options could they possibly be asking for before approving.




Quote from: LabeK on July 28, 2021, 09:33:52 AM
What I don't like about multitext:  you have to create a text window size to start the operation.  Normally, I snap the cursor to the center of extents, and set the text to be middle - middle justification.  I don't normally know the width of the total text, so I'm having to reposition a text window that I can't center easily.

I typically just initially set the width to something super-large.  Then, after typing my text in with the font and size I want, adjust accordingly, if needed-- using a Line's length or a Dimension Tool to ascertain what that width value needs to be.
In your case-- I assume the limestone bench is a set width.  Let's say it's 48" long, and you want the whole MultiText to take up all but 2 inches of that on each end.  So, initially start your MultiText 2" in from the left then type in 44" for the width.

It's all really pretty easy stuff.  Assuming the customer and yourself aren't restricting to a font that doesn't really exist (all CAPS, but SMALLER CAPS for the non-shift-key-created characters).


Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

Alvin Gregorio

Quote from: nikkipollard on July 28, 2021, 06:42:36 AM
How do you change the spacing between letters with Multi Line Text?
The Macro method would be the same as Alvins First Method except the computer does the spacing.
Multiline text works  - But It is a pain to change letter sizes.
The attached was done using the Macro Recorder. And Alvins Drawing- Because I don't have the font

I'd be interested in working with your Macro Nikki.  Out of curiosity and for learning's sake.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

nikkipollard

#13

Option Explicit
'
'## A Text script. All capital Text with the first letter of each word larger.##
' ## Select a Normal text graphic in the drawing and Run the script ##
'## The Script will get the string and Font from the Text Graphic ##
'## You will be asked for the texxt sizes and a spacing factor - The space factor can be used to
'increase spaces between text
' ##Note the New text will be a Group of individual text graphics which is difficult to edit ##
'                                                           
'=====================================================================
Dim TcDraw
Dim Gsel

Call Main

Set TcDraw = Nothing
Set Gsel = Nothing

'_______________________________________________________________________________
Sub Main

Set TcDraw = ActiveDrawing
Set Gsel = TcDraw.Selection

If Gsel.Count < 1 Then
MsgBox "Nothing Selected"
Exit sub
End If

Dim gfx
Set gfx = Gsel(0)

If gfx.Type <> "TEXT" Then
MsgBox "Wrong type of graphic selected"
Exit sub
End If

Dim str : str = gfx.Properties.Item("Info").Value
Dim Font : Font = gfx.Properties.Item("TextFont").Value
dim ts : ts =  Round(gfx.Properties.Item("TextSize").Value/1.6667)
'ts = Round(ts/10)
'ts = ts*10

Dim Size1 : Size1 = InputBox("First Letter Height","",ts)
If Size1=0 Then Exit Sub
Dim Size2 : Size2 = Size1 - (size1 / 5)
Size1 = CDbl(Size1)*1.6667
Size2 = InputBox("Word Height","",Size2)
If Size2 = 0 Then Exit Sub
  Dim Sf : Sf = InputBox("Letter Spacing Factor","",1)
        Sf = CDbl(Sf)
   Dim Space : Space = CDbl(Size2) * 0.45 * sf
         Size2 = CDbl(Size2) * 1.6667

Dim Verts : Set Verts = gfx.Vertices
Verts.UseWorldCs = True
Dim Words : Words = Split(str," ")
Dim Grop
Dim Bound
Dim dx : dx = Verts(2).X
Dim dy : dy = Verts(2).Y - Size1
Dim txt,fl,wrd,txt2,dv
Dim lay : lay = gfx.Layer.Name
Dim i
  Set Grop = TcDraw.Graphics.Add(7)

For i = 0 to UBound(Words)
wrd = Words(i)
wrd = UCase(wrd)
          Dim Letters, letter, Lwidth
        Call ToCharacterArray(wrd, Letters)
            fl = UCase(Letters(0))

Set txt = Grop.Graphics.AddText(fl,dx,dy,0,Size1)
txt.Properties.Item("TextFont").Value = Font
txt.Properties.Item("TextFormat").Value = 1025
txt.Layer = "0"
                        txt.Draw

Set Bound = txt.CalcBoundingBox
dv = (Bound.Max.X- Bound.Min.X) *Sf
            dx = dx+dv
Dim j
         For j = 1 to UBound(Letters)
          Set txt2 = Grop.Graphics.AddText(Letters(j),dx,dy,0,Size2)
txt2.Properties.Item("TextFont").Value = Font
txt2.Properties.Item("TextFormat").Value = 1025
txt2.Layer = "0"
            txt2.Draw
Set Bound = txt2.CalcBoundingBox
dv = (Bound.Max.X- Bound.Min.X) * Sf
            dx = dx+dv
             Next
            dx = dx + Space
Next

Grop.Layer = lay
Grop.Properties.Item("Info").Value = str
Grop.Draw
Dim UndoRec : Set UndoRec = TCdraw.AddUndoRecord("Add Special Text")
UndoRec.AddGraphic Grop
UndoRec.Close
TcDraw.ActiveView.Refresh

Set txt = Nothing
Set gfx = Nothing
Set txt2 = Nothing
Set Bound = Nothing

End Sub
'=====================================================================

Public Sub ToCharacterArray(ByVal my_string, ByRef NewArray)
Dim i
ReDim NewArray(Len(my_string) - 1)
For i = 1 To Len(my_string)
    NewArray(i - 1) = Mid(my_string, i, 1)
Next
End Sub


'======================================



Try this Alvin Copy it into the macro palette.
Add normal text to your drawing
use normal text - you don't need to worry about capitalization.
Select the text and run the macro.
It asks for 3 values
First Letter Text Height
Word text Height and a space factor - Incase you want to increase the spacing between the letters.
Other properties are taken from the selected text.
If you want to use flexible text You can add this property to the text, before txt.Draw and tx2.Draw
txt.Properties.Item("TextMode").Value = 3

Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h

Alvin Gregorio

Quote from: nikkipollard on July 28, 2021, 11:06:08 PM

Try this Alvin Copy it into the macro palette.
...

That's cool Nikki.

A couple of things I came across though:

  • The script result doesn't carry over the Flexible Text mode.  (but one can Explode the Group once into each individual character's Text then immediately assign Flexible to all of them)
  • The script result text Group's size does not correspond to my already inserted Text.

    • I have the option "Character height above the font base line" set.
    • I have inserted my 'FOX...DOG' Text string, set to Flexible.
    • I measure my Optima Nova Titling font capital letter A and it measures very close to 1" (it once measured 1", but I can't seem to replicate that now)
    • I select that Text string and run the Macro.  I select 1 for each of the values.
    • The macro result text string is not the same size in length as the Text text string.  Nor is the capital letter A the same 1" height.
.
Just thought I'd bring that to your attention; I know you like to work on these things and bring them as close to perfect as you can.
Alvin Gregorio
TurboCAD: v2024_Plat (31.0.77.1); v2022_Plat; v2020_Plat; v2019_DL; v20.2_PP
Lenovo Thinkpad P20Y laptop; Windows 11 Pro; i7-11800H 2.30GHz, 8-core; 32GB RAM; NVIDIA T1200
3D_Printer: Ender-3 S1 (NOT Pro)

LabeK

Nikki and Alvin:  You both are way ahead of me!  I will try this macro later today, and stay tuned in to your conversation.  Thanks both of you for weighing in.

nikkipollard

Hi Alvin I wish I new how to fix that with vbscript.
The Height of the Text - in ppms and Vbscript isn't as straight forward as you would like to think - it depends on the font. Because the size that you specify is recalculated by Turbocad to include the line height - each font has a different ascent and descent -
I took a guess at multiplying by 1.6667 - which works for some fonts.

Nikki
TC20 platinum, TC 2015 platinum
TC 2017 with lightworks
TC 2021 platinum
Windows 11 Home 22h