54
21
I have this .psd
(Photoshop file) and I'm trying to convert it to HTML & CSS.
Only thing I can't determine is what font they used in the .psd
How can I find out what fonts were used in the Photoshop file?
54
21
I have this .psd
(Photoshop file) and I'm trying to convert it to HTML & CSS.
Only thing I can't determine is what font they used in the .psd
How can I find out what fonts were used in the Photoshop file?
63
Depends on how you want to extract the information.
Select the Text tool (T icon with serifs) and click on the text area to edit it. It will show what font is being used in the Character window.
This will list all the embeddable fonts used in the PSD file, provided you can embed them.
In the Character tool, go to the font selection drop down. At the end of the list will be the fonts that are used in the image but are missing from your system. These will typically be greyed out.
If you see any rasterized images you need the font face of, you'd best export just that section as a clear, standalone image and use a service like What the Font to determine the font.
23
Save this script as a new file in your Photoshop > Presets > Scripts folder. Name it whatever you want, such as "Detect Fonts.jsx"
var p = new ActionReference();
function arrayUnique(a){
var t = []
i = a.length;
while(i--) {
var f = false,
n = t.length;
while (n--) {
if(a[i] === t[n]) {
f = true;
}
}
if(!f) {
t.push(a[i]);
}
}
return t;
}
function findFonts() {
p.putEnumerated( charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt') );
var c = executeActionGet(p).getInteger(charIDToTypeID('NmbL'))+1,
fonts = [];
while(c--) {
var r = new ActionReference(),
descLayer,
layerStyles,
countStyles;
r.putIndex( charIDToTypeID( 'Lyr ' ), c );
try {
descLayer = executeActionGet(r);
} catch (e) {
continue;
}
if(!descLayer.hasKey(stringIDToTypeID( 'textKey' ))) continue;
layerStyles = descLayer.getObjectValue(stringIDToTypeID('textKey')).getList(stringIDToTypeID('textStyleRange'));
countStyles = layerStyles.count;
while(countStyles--) {
var n = layerStyles.getObjectValue(countStyles).getObjectValue(stringIDToTypeID('textStyle')).getString(stringIDToTypeID('fontPostScriptName'));
fonts.push(n);
}
}
return arrayUnique(fonts).sort();
}
if (documents.length) {
var d = findFonts();
alert(d.length +' fonts found\n'+d.join('\n'));
} else {
alert('No fonts used in the active document.',);
}
1+500000 points. Incredible. – Half Crazed – 2016-03-03T16:42:56.637
1https://github.com/dcondrey/DetectFontsinPSD – davidcondrey – 2016-11-08T19:29:43.477
To write text in clipboard use this answer: http://stackoverflow.com/a/13983268/1578857
– Dima Kurilo – 2017-02-24T15:53:19.810(Photoshop CC2018) Error 8500: The requested property does not exist. Line 53: var n = layerStyles.getObjectValue(countStyles).getObjectValue(stringIDToTypeID('textStyle')).getString(stringIDToTypeID('fontPostScriptName')); – Drew – 2018-10-18T02:14:54.463
@Drew I am about to post an updated answer with a fixed version of the script – agrath – 2019-10-17T20:53:56.070
8
The PSD file format is documented by Adobe - you can read how it stores font information.
You could then examine a hex dump of the file and use the file format specification to find the fonts.
Alternatively, the font names ought to be visible in the output of the strings
utility found on Linux/Unix systems.
2+1: I came up with the same solution. For some reason GIMP didn't import the PSD correctly and I didn't know which font it was used. I analyzed the PSD file in an HEX editor to find it (Search for: "Font" as TEXT). Recommeded editor: "bless". – lepe – 2013-08-01T08:57:30.230
5
This is actually very easy to do using PS scripts, which can iterate through the layers of your PSD and pull text layer data.
I've been experimenting lately with a JavaScript-based script to overlay font information directly on comps that get delivered to developers. It's not finished but if there's still interest (I see this is quite old) I can put up a quick-and-dirty version that simply pops up the fonts used in a window.
UPDATE: I put together a rough but working "lite" version of the script I'm developing. Feel free to contribute - https://github.com/davidklaw/completer. For those unfamiliar with scripts just take the script file and put it under your PS Presets/Scripts folder and it'll be available under File -> Scripts.
wow this actually works pretty good :D (y)! – Ejaz – 2014-08-14T21:49:06.640
The question might be old, but it has almost 6,000 views. If you could provide a script, that would be very much appreciated! Welcome to Super User, by the way! – slhck – 2012-07-18T03:14:26.637
Good call. Open-source GitHub project is up. If anyone is familiar with basic JavaScript they should feel right at home. – David – 2012-07-18T13:08:35.927
4
Quick and Easy Way To Find Missing Fonts
Windows -> Character A small character box will display with fonts information.
Select font name dropdown and scroll down till end.
You will notice list of missing fonts in light grey color at the end of font list.
From : http://www.bala-krishna.com/how-to-find-fonts-used-in-psd-file/
There are numerous ways of enabling that panel: An additional one is Type -> Panels -> Character. – martixy – 2015-03-02T14:58:09.183
3
If the text has already been rasterized, the easy way would be to crop the area with the typeface you want to identify, save as a .png and upload it to WhatTheFont, where it should be able to tell you what it is, unless it is an obscure or bespoke one.
Identifont is another site you can use, where you describe characteristics of the typeface.
the text is not rasterized, meaning its in a separate layer. – dave – 2011-04-09T18:01:09.257
2@Dave: If the text is still editable, all you have to do is select it and see what appears in the font dropdown menu, or on the information palette. This is really obvious! – paradroid – 2011-04-10T11:10:09.623
1
Based on David's original answer (DetectFonts.jsx), I have modified the script to fix the issue reported by Drew in the comments: Find all the fonts used in a Photoshop file.
Follow the original instructions but use this script body instead - only difference is a few null checks (presumably either a photoshop version difference or something to do with missing data on particular object types, likely designer or operating system specific)
I will also submit a pull request to https://github.com/dcondrey/DetectFontsinPSD
var p = new ActionReference();
function arrayUnique(a) {
var t = []
i = a.length;
while (i--) {
var f = false,
n = t.length;
while (n--) {
if (a[i] === t[n]) {
f = true;
}
}
if (!f) {
t.push(a[i]);
}
}
return t;
}
function findFonts() {
p.putEnumerated(charIDToTypeID('Dcmn'), charIDToTypeID('Ordn'), charIDToTypeID('Trgt'));
var c = executeActionGet(p).getInteger(charIDToTypeID('NmbL')) + 1,
fonts = [];
while (c--) {
var r = new ActionReference(),
descLayer,
layerStyles,
countStyles;
r.putIndex(charIDToTypeID('Lyr '), c);
try {
descLayer = executeActionGet(r);
} catch (e) {
continue;
}
if (!descLayer.hasKey(stringIDToTypeID('textKey'))) continue;
layerStyles = descLayer.getObjectValue(stringIDToTypeID('textKey')).getList(stringIDToTypeID('textStyleRange'));
if(!layerStyles) continue;
countStyles = layerStyles.count;
while (countStyles--) {
var textStyle = layerStyles.getObjectValue(countStyles).getObjectValue(stringIDToTypeID('textStyle'));
if(!textStyle || !textStyle.hasKey(stringIDToTypeID('fontPostScriptName'))) continue;
var n = textStyle.getString(stringIDToTypeID('fontPostScriptName'));
fonts.push(n);
}
}
return arrayUnique(fonts).sort();
}
if (documents.length) {
var d = findFonts();
alert(d.length + ' fonts found\n' + d.join('\n'));
} else {
alert('No fonts used in the active document.');
}
1
I would take a snap of the text you need (preferably zoomed in) and use WhatTheFont to get some guesses. (Shouldn't the typeface be shown when you open the PSD and select the respective text, though?)
And of course, if it's not a web-safe font, you'll need to find an appropriate way of replacing it, or providing a fallback stack.
1
It will list all fonts used (among other handy things).
Looks like it has some potential, but it requires installing DreamWeaver.. – Drew – 2018-10-18T03:04:14.460
0
I wanted to know document fonts along with their styles, sizes, colors, formatting, etc. for web development and CSS purposes, so here's what I came up with:
0
Open Photoshop. Go to Windows » Character. A small box will pop up. Just select the text layer and the box will tell you the font family, size, et cetera.
0
Use online tool to get fonts of psd file
site is not active anymore – Michiel van der Blonk – 2019-03-28T18:18:08.467
0
Developer asked me almost the same think like you needed. I came up with editing simple script, to export layer properties (text, font name, font size, font color) which you need when developing, to a single txt file (should work on Windows machine).
Just save this like "ExportTexts.js" and put in Adobe Photoshop > Presets > Scripts.
After that, run (or restart) Photoshop and run script (File -> Scripts -> ExportTexts). Also make sure you ungrouped all layers before doing this. Exported file should be in a same dir as psd file.
if (documents.length > 0)
{
var docRef = activeDocument;
CurrentFolder = activeDocument.path;
var outputFile = new File(CurrentFolder + "/" + activeDocument.name + "fonts.txt" );
outputFile.open("w");
for (var i = docRef.layers.length-1 ; i >=0 ; i--)
{
docRef.activeLa`enter preformatted text here`yer = docRef.layers[i]
if (docRef.activeLayer.kind == LayerKind.TEXT)
{
outputFile.write(
docRef.activeLayer.textItem.contents + "\n" +
docRef.activeLayer.textItem.font +"," +
docRef.activeLayer.textItem.size +"," +
docRef.activeLayer.textItem.color.rgb.hexValue + "\n\n\n");
}
}
outputFile.close();
alert("Finished");
}
else
{
alert("You must have at least one open document to run this script!");
}
docRef = null
Your script is broken on line 8 – davidcondrey – 2015-04-29T22:17:31.607
And on line 12. Error 8500, property does not exist: outputFile.write( . – Drew – 2018-10-18T03:13:20.557
0
There's a free Photoshop Extension/Panel which can do this job for you, Free Photoshop Font Detector (http://www.layerhero.com/photoshop-font-detector/), and if you want to collect/copy font files from system folder, try Photoshop Art Packer(http://www.layerhero.com/photoshop-art-packer/)
The "Free Photoshop Font Detector" is no longer available as a free download and is now part of an expensive extension FontHero for $39.
– paulmz – 2016-11-08T17:38:23.777None of those are available. LayerHero is dead.. Amazingly, you can download Font Detector from the WayBack machine: https://web.archive.org/web/20171211184218/http://www.layerhero.com/photoshop-font-detector/ However I haven't been able to install it, neither with Anastasiy's Extension Manager nor Adobe ExMan.
– Drew – 2018-10-18T03:02:33.1930
There is an option on the Layers tab that lets you filter all of the layers to show only the fonts. You have to select each layer to actually see them and it is useful only if you need a quick glance at them
Hope it helps someone three years after this was asked.
-1
To get the fonts information form a PSD file you can use online tools if you can't or won't use Photoshop (or if you prefer using Gimp, that rasterizes PSD fonts).
For example you can try out this html5 PSD font online extractor "Get PSD Fonts".
It's a PSD font information extractor based on Melitingice Github project psd.js that does not require uploading files, working locally in your browser page
It opens the file in javascript, without sending it to a server, in your own browser page! You have to drop the file to specify the file path... – Giovazz89 – 2016-05-09T13:33:43.950
You might want to disclose any affliation you have with the projects mentioned, even if its free. – Journeyman Geek – 2016-05-09T14:15:39.677
As of CC2018, 2 of the scripts below and the jsx plugin are broken. I commented specifically for each. – Drew – 2018-10-18T03:14:32.603