Jump to content

Change text font in existing table


EdCycler

Recommended Posts

I have an existing table that was imported from Excel and has a Calibri font. It is a large table. How can I change the font of all cells at the same time. I can only see how to do it one cell at a time.

 

Ed

Link to comment
Share on other sites

  • Replies 40
  • Created
  • Last Reply

Top Posters In This Topic

  • EdCycler

    20

  • tmreyes

    10

  • chelsea1307

    6

  • gmiani

    5

Top Posters In This Topic

Posted Images

My excell has RomanS, thats my companies standard font, another thing you might face is issues with printing, i could not get romans to plot right when in a autocad table that was linked. I dont know why, if i typed it directly into the table it plotted fine but if it was linked to excel it plotted really light, only font with the problem

untitled.jpg

Link to comment
Share on other sites

Thanks for your continued help.

 

But I do not have the original XL file. Is there a way to export the Autocad table to XL? Then I could change the font and import it back to Autocad...

 

Still somewhat arkward.

Link to comment
Share on other sites

The font still seems to be locked. I am able to export the table to XL, change the font, and import to AutoCAD.

 

Once in AutoCAD the font remains locked. I need to apply a non-true type font, so this process works, but not for me.

Link to comment
Share on other sites

I did a dxfout, search and replace of fCalibri and then dxfin. Arkward but it worked. Now I can control the table with styles.

 

Example:

old - {\fCalibri|b0|i0|c0;VOLTAGE DIRECT CURRENT

new - VOLTAGE DIRECT CURRENT

Link to comment
Share on other sites

  • 2 weeks later...

Alright...I think I've got a fix to this one...might not work for everyone in every situation and I haven't worked out all of the bugs/nuances. Autocad utilizes a font map to replace typically missing, errant, or similar-but-not-quite-right fonts with a font that it recognizes. This data is held in *.fmp file.

 

PROCEDURE

1) Type command "options" or "op" for short

2) Look on your "files" tab, under "text editor..." and find "font mapping file" and note the locations (should be on under your docs and settings deep down in the Autodesk support data folder) and more than likely is called "acad.fmp"

3) Find and open that file (it should open in Notepad)

4) At the bottom of the string of data, enter your own font problem, syntax is key and it must appear in this form

 

ORIG FONT; FONT TO CHANGE TO.xxx Updated by gmiani - this format is now correct

 

Ex. Arial; Romans.shx Updated by gmiani - this format is now correct

 

Note: Notice that the first font has no extension...only the second.

5) The cautious would save a copy of the original font map before altering the original...thats your choice.

6) Close your drawing (if you haven't already)....and reopen. Poof...text is changed.

7) If you have cell styles, you can apply them now and it will change all the other characteristics of the cell.

 

I've been struggling with this very topic for a while now. I have a LARGE amount of data that needs to be placed from excel and put onto our ACAD set. But our client requires a particular size and style font. The formatting of our excel spreadsheet was too complex to simply link it without the formatting. But the problem arose with taking the "Arial" text of Excel and turn it into "Romans" as required.

 

As others have found, establishing a cell style will change formatting only so far (text height, width factor, etc), but it would NOT change the font. This fix will automatically change the font as soon as you reopen the drawing.

 

The drawback is that it will always change that text until you remove the font map edit as shown above. So in the future if you want that text to show up...it won't...until you remove it from the font map. This can only be applied on a drawing by drawing basis (not layout by layout).

Link to comment
Share on other sites

It did not work for me.

There was no file at the location, so I created an empty one and added Calibri, Romans.shx.

 

Nothing happened.

 

Ed

Link to comment
Share on other sites

Ed

 

Well...after all my talk of syntax....I made a little mistake it seems. The format should have a semi-colon....not a comma. I will edit my original post. Hope that does the trick...and sorry for the initial misinformation.

-gabe

 

If you are still having issues...consider these points.

 

1) Under the "Font Mapping File" location (within the "Text editor,..." section, under the "files" tab, from the Options Window), there WAS NO file called out? I was almost positive that ACAD came with this file when installed. If not, its fine that you created a *.fmp...proceed to #2 below.

 

2) After you created the file (which as far as I can tell, what you put in is all you need...with the exception of the aforementioned syntax) did you remember to direct the "font mapping file" path to that file?

 

3) Double check your original font name...ensure that it is "calibri" verbatum.

Link to comment
Share on other sites

Still does not work--

 

This is the path:

Font Mapping File

-->C:\Program Files\Autodesk\Acade 2009\Acade\ACAD.FMP

This is my text: Calibri; Romans.shx

 

I am using AutoCAD Electrical.

Link to comment
Share on other sites

I like your idea, if it works because it is simple, but I found this VBA macro on the web by jhopeross (http://discussion.autodesk.com/forums/message.jspa?messageID=6123737) and it works OK. I modified his slightly:

 

Public Sub FixTableText()

On Error GoTo GetBOMTableItemsErr

 

Dim FilterType(0) As Integer

Dim FilterData(0) As Variant

 

Dim SS1 As Object

Dim ans As String

Dim Celltext As String

Dim CatalogNumber As String

Dim TableRows As Integer

Dim TableCols As Integer

Dim PPos As Integer

Dim CRow As Integer

Dim CCol As Integer

Dim CurTable As Object

Dim I As Integer

Dim AcadApp As AutoCAD.AcadApplication

Dim ThisDrawing As AutoCAD.AcadDocument

 

DoEvents

Set AcadApp = AutoCAD.Application

Set ThisDrawing = AcadApp.ActiveDocument

 

ThisDrawing.Application.ZoomExtents

 

DoEvents

 

Set SS1 = ThisDrawing.SelectionSets.Item("SS1")

If SS1 Is Nothing Then

Set SS1 = ThisDrawing.SelectionSets.Add("SS1")

Else

SS1.Clear

End If

FilterType(0) = 0

FilterData(0) = "ACAD_TABLE"

 

SS1.Select acSelectionSetAll, , , FilterType, FilterData

 

If SS1.Count > 0 Then

For Each CurTable In SS1 ' Process the Tables on this drawing

TableRows = CurTable.Rows

TableCols = CurTable.Columns

For CRow = 0 To TableRows - 1

For CCol = 0 To TableCols - 1

Celltext = CurTable.GetCellValue(CRow, CCol)

DoEvents

If Celltext Like "{*;*" Then

PPos = InStrRev(Celltext, ";")

If PPos > 0 Then

Celltext = Mid(Celltext, PPos + 1, Len(Celltext) - PPos)

If Celltext Like "*}" Then

Celltext = Left(Celltext, Len(Celltext) - 1)

End If

CurTable.SetCellValue CRow, CCol, Celltext

I = I + 1

End If

End If

'Debug.Print "CRow: " & CRow & " CCol: " & CCol & Celltext

Next CCol

Next CRow

Next CurTable

End If

 

If Not SS1 Is Nothing Then

SS1.Clear

SS1.Delete

Set SS1 = Nothing

End If

 

If I = 0 Then

MsgBox "All Table Text Fixed!", vbInformation, "No Table Text Problems"

Else

MsgBox "All Table Text Fixed!", vbInformation, "Number of cells fixed " & I

End If

 

Exit Sub

GetBOMTableItemsErr:

 

If UCase$(Error) Like "*KEY NOT FOUND*" Then

Resume Next

Else

MsgBox Error

Resume Next

End If

 

End Sub

Link to comment
Share on other sites

REVISED by gmiani

I all too quickly assumed that the font map depended on the font's FILE name...and not the font name. BUT IT IS THE OTHER WAY AROUND upon further testing.

 

YOU MUST USE THE FONT NAME (not the file name for the font).

 

Hmmm...interesting. One more check for you. Calibri, which i assume is a true type (ttf), you must keep in mind that each type of calibri (i.e. bold, italic, narrow, etc) will have an slightly different font name.

 

For example, Arial comes in bold, narrow, italic. So the correct nomenclature for the font map would be Arial; romans.shx or Arial Narrow;romans.shx

 

Each type that you use in your excel will need to be addressed in the font map. And again...it has to appear exactly as the FONT name...not the file name.

 

If you already did this...then we're back to the drawing board.

 

Also, when you access a cell in your linked table, then select the text for editting, it brings up the text dialog box...does this say that it is using "Calibri"?

Link to comment
Share on other sites

Join the conversation

You can post now and register later. If you have an account, sign in now to post with your account.
Note: Your post will require moderator approval before it will be visible.

Guest
Unfortunately, your content contains terms that we do not allow. Please edit your content to remove the highlighted words below.
Reply to this topic...

×   Pasted as rich text.   Restore formatting

  Only 75 emoji are allowed.

×   Your link has been automatically embedded.   Display as a link instead

×   Your previous content has been restored.   Clear editor

×   You cannot paste images directly. Upload or insert images from URL.


×
×
  • Create New...