Question

Is there a way to find Font used in Numbers?

Opening the spreadsheet on my Mac is fine, but I get this error message when opening the same document on iPad (iOS)

The font TIMES-Roman is missing.

I want to find which cell(s) are using this font. It most likely came from pasting in styled text and I need a tool or way to track down the offending cells or text.

How can I find the text using this specific font?

Était-ce utile?

La solution

To check which cells have the font family "TIMES-Roman," run the following script. It will generate a dialog that will display the column and row of any cells that contain that font. To run the script:

  • Open your spreadsheet in Numbers and close all other open spreadsheets
  • Open Script Editor (/Applications/Utilities/Script Editor.app)
  • Switch the language in the top left corner of the window from "AppleScript" to "JavaScript"
  • Paste in the script below and click the button with a "play" icon at the top of the window

If you see a blank dialog box, the script couldn't find any cells with the offending font. Please also note that this script assumes that you only have one table and one sheet in your document.

var offendingFont = "TIMES-Roman"

var culprits = []
var table = Application('Numbers').documents[0].sheets[0].tables[0]
var cols = []
for (var i = 0; i < table.columnCount(); ++i) cols.push(String.fromCharCode(65 + i))
var rows = []
for (var i = 0; i < table.rowCount(); ++i) rows.push(i + 1)
for (var r of rows) {
    for (var c of cols) {
        if (table.cells[c + r].fontName() === offendingFont) culprits.push(c + r)
    }
}

var app = Application.currentApplication()
app.includeStandardAdditions = true
app.displayDialog(culprits.join(", "))

Since you said you never use any flavor of "Times" font, here's an additional, altered version of the script that finds any font with "times" anywhere in the name (this might produce better results):

var offendingFontExcerpt = "times"

var culprits = []
var table = Application('Numbers').documents[0].sheets[0].tables[0]
var cols = []
for (var i = 0; i < table.columnCount(); ++i) cols.push(String.fromCharCode(65 + i))
var rows = []
for (var i = 0; i < table.rowCount(); ++i) rows.push(i + 1)
for (var r of rows) {
    for (var c of cols) {
        if (table.cells[c + r].fontName().toLowerCase().indexOf(offendingFontExcerpt) > -1) culprits.push(c + r)
    }
}

var app = Application.currentApplication()
app.includeStandardAdditions = true
app.displayDialog(culprits.join(", "))

Autres conseils

Just type Command-T with a cell highlighted. You'll see something like this: enter image description here

It is not clear what your actual question is. I will take a different interpretation than the others: I think you want to find the cell that has the unwanted font.

I am not aware of a way to do that easily in Numbers. One trick would be to select all cells and change them all to a different font. But that's no good if you need different fonts to be there.

Here's something not too bad, though:

  1. Open the file with LibreOffice.
  2. Save it as HTML
  3. Open the HTML with TextEdit
  4. Search for "TIMES"

For example, I can tell that the only cell set to "Lucida Grande" is one that has "XX" in it because when I open the HTML in TextEdit, and search for Lucida, the search box says there is only one instance and it highlights the line

<td height="20" align="left"><font face="Lucida Grande">XX</font></td>

Then I can open the original file in Numbers and go to that cell or us Find to look for the value in that cell, i.e., XX in my example.

Yes. With your spreadsheet open there should a separate section on the right of the spreadsheet. At the top of this section, there are 4 labels: Table, Cell, Text, and Arrange. Click on the Text label. The section on the right changes and near the top is a pulldown to select your font. The current font is displayed for anything you have selected in the spreadsheet. The setup is shown below.

enter image description here

Licencié sous: CC-BY-SA avec attribution
Non affilié à apple.stackexchange
scroll top