Change fonts of photoshop text layer via panel developed by Flex Builder
Hi everyone,
I am developing photoshop cs5 plugin which will change font family of text layer. Changeing system font is ok but my embedded font is not loading on text layer.
syntax used to change font on text layer.
var AD = activeDocument;
AD.activeLayer.textItem.font="Verdana";
I have few webfonts on my local drive. how can i use this font so that it can reflect on text layer in runtime with out installing manually in system font.
In developed panel, embedded fonts are rendering but I need to change font of text layer on clicking fonts list from panel.
Does anyone have any idea on it? Please help me.
Thanks,
PluginBishnu
Flash.text.Font.hasGlyphs()
Similar Messages
-
How do I change fonts in a Text field ??
Okay I've tried to implement a JComboBox that allows the user to change fonts in the text field. So far I've tried different methods to do it but to no avail. Could somebodoy here read the programs source code for me and tell me where I went wrong?
/* * My GUI Client */
import javax.swing.*;
import javax.swing.text.*;
import java.awt.*;
import javax.swing.event.*;
//for HTML Headers
import javax.swing.text.StyledEditorKit.*;
import javax.swing.text.html.HTMLEditorKit.*;
import javax.swing.text.html.*;
import javax.swing.event.HyperlinkListener;
import javax.swing.event.HyperlinkEvent;
import javax.swing.event.HyperlinkEvent.EventType;
import javax.swing.text.html.HTMLFrameHyperlinkEvent;
//for layout managers
import java.awt.event.*;
//for action and window events
import java.io.*;
import java.net.*;
import java.awt.GraphicsEnvironment;
//for font settings
import java.lang.Integer;
import java.util.Vector;
import java.awt.font.*;
import java.awt.geom.*;
public class guiClient extends JFrame implements ActionListener {
protected static final String textFieldString = "JTextField";
protected static final String loadgraphicString = "LoadGraphic";
protected static final String connectString = "Connect";
static JEditorPane editorPane;
static JPanel layoutPanel = new JPanel(new BorderLayout());
static JPanel controlPanel = new JPanel(new BorderLayout());
static JPanel buttonPanel = new JPanel(new BorderLayout());
static JPanel fontPanel = new JPanel(new BorderLayout());
static PrintStream out;
static DrawPanel dPanel;
static DrawPanel dPButton;
static DrawPanel dFonts;
static DrawControls dControls;
static DrawButtons dButtons;
static String userString;
static String currentFont;
String fontchoice;
String fontlist;
static JTextField userName = new JTextField();
public static JMenuBar menuBar;
private static JButton connectbutton = new JButton("Connect");
static boolean CONNECTFLAG = false;
//create the gui interface
public guiClient() {
super("My Client");
// Create a ComboBox
GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
String envfonts[] = gEnv.getAvailableFontFamilyNames();
Vector vector = new Vector();
for ( int i = 1; i < envfonts.length; i++ ) {
vector.addElement(envfonts);
JComboBox fontlist = new JComboBox (envfonts);
fontlist.setSelectedIndex(0);
fontlist.setEditable(true);
fontlist.addActionListener(this);
fontchoice = envfonts[0];
//Create a regular text field.
JTextField textField = new JTextField(10);
textField.setActionCommand(textFieldString);
textField.addActionListener(this);
//Create an editor pane.
editorPane = new JEditorPane();
editorPane.setContentType("text");
editorPane.setEditable(false);
//set up HTML editor kit
HTMLDocument m_doc = new HTMLDocument();
editorPane.setDocument(m_doc);
HTMLEditorKit hkit = new HTMLEditorKit();
editorPane.setEditorKit( hkit );
editorPane.addHyperlinkListener( new HyperListener());
//Create whiteboard
dPanel = new DrawPanel();
dPButton = new DrawPanel();
dFonts = new DrawPanel();
dControls = new DrawControls(dPanel);
dButtons = new DrawButtons(dPButton);
//JLable fontLab = new JLabel(fontLable);
//fontLab.setText("Fonts");
//Font newFont = getFont().deriveFont(1);
//fontLab.setFont(newFont);
//fontLab.setHorizontalAlignment(JLabel.CENTER);
JPanel whiteboard = new JPanel();
whiteboard.setLayout(new BorderLayout());
whiteboard.setPreferredSize(new Dimension(300,300));
whiteboard.add("Center",dPanel);
whiteboard.add("South",dControls);
whiteboard.add("North",dButtons);
JScrollPane editorScrollPane = new JScrollPane(editorPane);
editorScrollPane.setVerticalScrollBarPolicy( JScrollPane.VERTICAL_SCROLLBAR_ALWAYS);
editorScrollPane.setPreferredSize(new Dimension(250, 145));
editorScrollPane.setMinimumSize(new Dimension(50, 50));
//put everything in a panel
JPanel contentPane = new JPanel();
JPanel fontPane = new JPanel();
contentPane.setLayout(new BoxLayout(contentPane, BoxLayout.Y_AXIS));
//add whiteboard
contentPane.add(whiteboard);
//add editor box
contentPane.add(editorScrollPane);
//add spacer
contentPane.add(Box.createRigidArea(new Dimension(0,5)));
//add textfield
contentPane.add(textField);
//set up layout pane
//layoutPanel.add(GridLayout(2,1),fontLab);
layoutPanel.add( BorderLayout.NORTH, fontlist);
layoutPanel.add(BorderLayout.WEST,new Label("Name: ")); //add a label
layoutPanel.add(BorderLayout.CENTER, userName ); //add textfield for user names
layoutPanel.add(BorderLayout.SOUTH, connectbutton);//add dropdown box for fonts
//fontPane.add(BorderLayout.NORTH,fontlist);
contentPane.add(layoutPanel);
contentPane.add(controlPanel);
contentPane.add(buttonPanel);
//Create the menu bar.
menuBar = new JMenuBar();
setJMenuBar(menuBar);
//Build the first menu.
JMenu menu = new JMenu("File");
menu.setMnemonic(KeyEvent.VK_F);
menuBar.add(menu);
//a group of JMenuItems
JMenuItem menuItem = new JMenuItem("Load Graphic", KeyEvent.VK_L);
menu.add(menuItem);
menuItem.setActionCommand(loadgraphicString);
menuItem.addActionListener(this);
connectbutton.setActionCommand(connectString);
connectbutton.addActionListener(this);
setContentPane(contentPane);
static private void insertTheHTML(JEditorPane editor, String html, int location) throws IOException {
HTMLEditorKit kit = (HTMLEditorKit) editor.getEditorKit();
Document doc = editor.getDocument();
StringReader reader = new StringReader(html);
try {
kit.read(reader, doc, location);
} catch (BadLocationException e) {}
//listen for actions being performed and process them
public void actionPerformed(ActionEvent e) {
//if the action is from the textfield (e.g. user hits enter)
if (e.getActionCommand().equals(textFieldString)) {
JTextField fromUser = (JTextField)e.getSource();
if (fromUser != null){
//place user text in editor pane
//send message to server
if (userName.getText() != null) {
userString = userName.getText().trim();
out.println(userString + ": " + fromUser.getText());
fromUser.setText("");
} else if(e.getActionCommand().equals(connectString)) {
CONNECTFLAG = true;
} else if (e.getActionCommand().equals(loadgraphicString) ) {
final JFileChooser fc = new JFileChooser();
int returnVal = fc.showOpenDialog(this);
if (returnVal == JFileChooser.APPROVE_OPTION) {
File file = fc.getSelectedFile();
dPanel.loadImage(file.getAbsolutePath());
sendImage(file);
else if (e.getActionCommand().equals(fontlist)){
JComboBox cb = (JComboBox)e.getSource();
String newSelection = (String)cb.getSelectedItem();
currentFont = newSelection;
userString = currentFont;
return;
/*public void itemStateChanged (ItemEvent e) {
if ( e.getStateChange() != ItemEvent.SELECTED ) {
return;
if ( list == fontlist ) {
fontchoice = (String)fontlist.getSelectedItem();
userString.changeFont(fontchoice);
//append text to the editor pane and put it at the bottom
public static void appendText(String text) {
if (text.startsWith("ID ") ) {
userString = text.substring(3);
} else if (text.startsWith("DRAW ") ) {
if (text.regionMatches(5,"LINE",0,4)) {
dPanel.processLine(text);
}else if (text.regionMatches(5,"POINTS",0,5)) {
dPanel.processPoint(text);
} else if (text.startsWith("IMAGE ") ) {
int len = (new Integer( text.substring(6, text.indexOf(",")))).intValue();
//get x and y coordinates
byte[] data = new byte[ (int)len ];
int read = 0;
try {
while (read < len) {
data = text.getBytes( text.substring(0, len) );
} catch (Exception e) {}
Image theImage = null;
theImage = dPanel.getToolkit().createImage(data);
dPanel.getToolkit().prepareImage(theImage, -1, -1, dPanel);
while ((dPanel.getToolkit().checkImage(theImage, -1, -1, dPanel) & dPanel.ALLBITS) == 0) {}
dPanel.drawPicture(0, 0, theImage);
} else {
//set current position in editorPane to the end
editorPane.setCaretPosition(editorPane.getDocument().getLength());
//put text into the editorPane
try {
insertTheHTML(editorPane, text, editorPane.getDocument().getLength());
} catch (IOException e) {}
} //end of appendText(String)
public void sendImage(File file) {
//find length of file
long len = file.length();
//read file into byte array
byte[] byteArray = new byte[(int)len];
try {
FileInputStream fstream = new FileInputStream(file);
if (fstream.read(byteArray) < len) {
//error could not load file
} else {
out.println("IMAGE " + len + ",");
out.write(byteArray, 0, (int)len); //write file to stream
} catch(Exception e){}
//run the client
public static void main(String[] args) {
String ipAddr=null, portNr=null;
if (args.length != 2) {
System.out.println("USAGE: java guiClient IP_Address port_number");
System.exit(0);
} else {
ipAddr = args[0];
portNr = args[1];
JFrame frame = new guiClient();
frame.addWindowListener(new WindowAdapter() {
public void windowClosing(WindowEvent e) { System.exit(0); }
frame.pack();
frame.setVisible(true);
while(CONNECTFLAG == false){}
//sames as previous client,
//set up connection and then listen for messages from the Server
String socketIP = ipAddr;
int port = Integer.parseInt(portNr);
//the IP address of the machine where the server is running
Socket theSocket = null;
//communication line to the server
out = null;
//for message sending
BufferedReader in = null;
//for message receiving
try {
theSocket = new Socket(socketIP, port );
//try to connect
out = new PrintStream(theSocket.getOutputStream());
dPanel.out = out;
//for client to send messages
in = new BufferedReader(new InputStreamReader(theSocket.getInputStream()));
BufferedReader userIn = new BufferedReader(new InputStreamReader(System.in));
String fromServer;
while ((fromServer = in.readLine()) != null) {
appendText(fromServer);
if (fromServer.equals("BYE")) {
appendText("Connection Closed");
break;
out.close();
//close all streams
in.close();
theSocket.close();
//close the socket
} catch (UnknownHostException e) {
//if the socket cannot be openned
System.err.println("Cannot find " + socketIP);
System.exit(1);
} catch (IOException e) { //if the socket cannot be read or written
System.err.println("Could not make I/O connection with " + socketIP);
System.exit(1);
class HyperListener implements HyperlinkListener {
public JEditorPane sourcePane;
public void hyperlinkUpdate(HyperlinkEvent e) {
if (e.getEventType() == HyperlinkEvent.EventType.ACTIVATED) {
sourcePane = (JEditorPane) e.getSource();
if (e instanceof HTMLFrameHyperlinkEvent) {
HTMLFrameHyperlinkEvent event = (HTMLFrameHyperlinkEvent) e;
System.out.println(event.getTarget());
HTMLDocument doc = (HTMLDocument) sourcePane.getDocument();
doc.processHTMLFrameHyperlinkEvent(event);
else {
try {}
catch (Exception ev){
ev.printStackTrace();
Well sorry the source code takes up the whole forum but I need a good feedback from this.All right...
public class guiClient extends JFrame implements ActionListener {
static String userString;
static String currentFont;
String fontchoice;
String fontlist;
static JTextField userName = new JTextField();
public guiClient() {
super("My Client");
public guiClient() {
super("My Client");
// Create a ComboBox
GraphicsEnvironment gEnv = GraphicsEnvironment.getLocalGraphicsEnvironment();
String envfonts[] = gEnv.getAvailableFontFamilyNames();
Vector vector = new Vector();
for ( int i = 1; i < envfonts.length; i++ ) {
vector.addElement(envfonts);
JComboBox fontlist = new JComboBox (envfonts);
fontlist.setSelectedIndex(0);
fontlist.setEditable(true);
fontlist.addActionListener(this);
fontchoice = envfonts[0];
//Create a regular text field.
JTextField textField = new JTextField(10);
textField.setActionCommand(textFieldString);
textField.addActionListener(this);
public void actionPerformed(ActionEvent e) {
//if the action is from the textfield (e.g. user hits enter)
if (e.getActionCommand().equals(textFieldString)) {
JTextField fromUser = (JTextField)e.getSource();
if (fromUser != null){
//place user text in editor pane
//send message to server
if (userName.getText() != null) {
userString = userName.getText().trim();
out.println(userString + ": " + fromUser.getText());
fromUser.setText("");
else if (e.getActionCommand().equals(fontlist)){
JComboBox cb = (JComboBox)e.getSource();
String newSelection = (String)cb.getSelectedItem();
currentFont = newSelection;
userString = currentFont;
return; -
Is there a way to locate file path of a font used in text layer?
I delivered a file to a client and there is a missing text layer dependency.
I thought I delivered the correct font for the text layer but there is an issue somewhere...perhaps multiple versions of the font on my system..or slight
difference in the font name. The project loads without the error on my system.
Is there a method within After Effects to obtain a file path for the font I am using? ..or at least a way to get more detailed information
about the font itself?...I mean beyond what is available in the font selection window.
I need to locate the exact font in the exact folder After Effects is pulling it from.even better..I did a search within Fontbook for comparable file name..as I don't add and remove fonts constantly
and discovered the font and also discovered why there was confusion in AEFX..the font had been generated in
Fontographer and it's file name did not match error prompt or collected file report
that was better than suffering through the 100's of possible results I was getting in Finder. And Fontbook also provided the path to the exact font used...
..feeling a bit silly...but I think this will work. -
Photoshop CS6 Layer via Copy Question
Hi,
I've noticed that when a selection is Layer via Copyed in Photoshop CS6, it appears brighter and slightly more saturated in color than the original selection it came from. Currently I manually make lighting and color adjustments to match it back to the original, but is there a way to prevent this altogether? There are no masks or adjustment layers or any other tools being used when this happens -- just a simple Layer via Copy.
I'm not sure if there is a setting that will help cut out that time consuming manual step of retouching to match the original selection, but any suggestions would be helpful. Thanks!There shouldn't be any difference if it's just layer via copy in the same document.
What operating system are you using?
Is photoshop cs6 up to date?
(Help>Updates from within photoshop cs6)
Could you post a screenshot(s) showing the difference and your layers panel? -
Changing font in a text area?
how do you change the font in a text area
i thought it might have been navi.setFont(Font.Verdana);
but no ...Right idea, but it's off. Try this:
navi.setFont(new Font("Verdana", Font.PLAIN, 12)); -
When writing comments or sending messages,etc., I would like to be able to have access to text options such as; bold, underline, change font, font size,color, etc. I've seen others do this but cannot find anything on my desktop to allow me these write tools.
Orange Firefox button>Options>Options>Security, Privacy etc.
If the Firefox button isn't showing - right click on a toolbar space and uncheck the Menu Bar, this will reveal the Firefox button and you can toggle from one to the other.
Or, in the Menu Bar>Tools>Options. -
Change Font Size with PDF attachment via e--mail
Hi experts,
I want to send mail with PDF attachment . Now the attachment is ok but only the font size in PDF is a little small.
Is that possible to Change the font size of PDF
Below is my code:
first the data comes from an internal table, then changed to an ABAP Pool.
* Create a new spool from the data in gt_data_pdf
new-page print on
destination c_local "<<== my printer
cover text text-027 "<<== Title or Spool req. name
list name space
list dataset space
immediately space " X means print now
keep in spool c_checked " X means keep spool
new list identification c_checked
line-size 255
line-count 65
no dialog .
loop at gt_data_pdf.
write: / gt_data_pdf-line.
endloop.
new-page print off.
lv_spoolid = lv_spdel-rqident = sy-spono.
lv_spdel-sys = sy-sysid.
*Convert ABAP Spool to PDF
call function 'CONVERT_ABAPSPOOLJOB_2_PDF'
exporting
src_spoolid = lv_spoolid
no_dialog = c_checked
importing
pdf_bytecount = lv_pdf_fsize
tables
pdf = lt_pdf_table
exceptions
others = 0.
call function 'SO_NEW_DOCUMENT_ATT_SEND_API1'
exporting
document_data = lv_doc_chng
put_in_outbox = space
commit_work = c_checked
tables
packing_list = lt_objpack
object_header = lt_objhead
contents_bin = lt_objbin
contents_txt = lt_objtxt
receivers = lt_reclist
exceptions
too_many_receivers = 1
document_not_sent = 2
operation_no_authorization = 4
others = 99.
Anyone could help me?
Thanks a lot.
Sincerely
JulieHi,
we don´t have many options for setting the font type and size in an ABAP list. One option is that you print the output using either SmartForms or AdobeForms, where you can control font type as well as size. This one requires additional work.
Another option is to use the instruction Print-Control:
NEW-PAGE PRINT ON.
PRINT-CONTROL FONT 1 SIZE 1 LPI 6 CPI 10.
WRITE: /10 'FONT 1 size 1 LPI 6 cpi 10'.
SKIP.
PRINT-CONTROL FONT 1 SIZE 5 LPI 6 CPI 5.
WRITE: /10 'FONT 1 size 5 LPI 6 cpi 5'.
SKIP.
PRINT-CONTROL FONT 2 SIZE 5 LPI 6 CPI 10.
WRITE: /10 'FONT 2 size 5 LPI 6 cpi 10'.
SKIP.
NEW-PAGE PRINT OFF. -
Changing font color in Text Box tool in Acrobat 9.0
The default color is coming out red but I can't figure out how to change it to black..anyone know??
sorry folks, found my answer..
if anyone else has the problem - select the text, go to View - then toolbars - the the properties bar and the font is in that bar... -
End user have ability to change font style in text field of interactive pdf form?
Does the end user of an interactive pdf form able to change the font style, i.e.: make something bold or underline a word in a text field?
I am making a form with text fields and the end user would like the ability to make something bold or underline it.. I do not see anywhere in acrobat that allows styles to be changed.
I have created the form in Indesign > saved it as an interactive pdf and brought it into Acrobat.Thank you for the quick response! Do you set this in Indesign before exporting or do you set this in Acrobat? I am in Acrobat 10.1.10 and when I go to properties it doesn't give me 'options' to choose from.
-
Animating a photoshop text layer in After Effects
Im trying to animate the test from a page that was built in photoshop. I save the layers all seperatly but AE just recognizes the text box not the text itself, so i am unable to use the text animations on it. Is this even possible and if so how do i get it to work right?
Have you tried Layer --> Convert to editable text? If that doesn't work, then it's a clear indication that something is up with the text like specific formatting being used, faux italic and bold text decorations etc.. AE can't replicate some of these things. It should show you the stored rasterized layer, though. Also check for grouping, clipping masks, layer styles etc. in the PSD. Certain combinations might also cause layers to not render...
Mylenium -
How to change font size of text inside a "text box" form the Drawing Markups?
Hi,
I expected there to be an option to change the font size after I selected the text and right-clicked, but no, there is only one option that allows you to change the text style but not the font size.
Does anyone know how to change the font size?Don't know what the e-mail is about, why not just log into the forums. In any case, it does not sound like a text box, but one of the other text options (like the Typewriter tool). The regular text edit tool allows you to edit the text and fonts in a regular text box. Select the box and use ctrl-E. You may have to select the text edit tool (name changed in AAX) first. Such editing is not really recommended. Editting in Acrobat should be limited to simple changes, and those often become a pain. The best method of fixing the problem is in the original document and then creating a new PDF.
-
Changing Font on Alt text?
Is there a way to change the font/color of alternative text?
Or is this all part of the user browser specifications?
Thanks!No, you cannot change that. But the alt attribute's value is
not displayed
in any modern browser except for IE. Perhaps you should
consider using the
title attribute, which is displayed in all browsers?
Murray --- ICQ 71997575
Adobe Community Expert
(If you *MUST* email me, don't LAUGH when you do so!)
==================
http://www.dreamweavermx-templates.com
- Template Triage!
http://www.projectseven.com/go
- DW FAQs, Tutorials & Resources
http://www.dwfaq.com - DW FAQs,
Tutorials & Resources
http://www.macromedia.com/support/search/
- Macromedia (MM) Technotes
==================
"justine_oc" <[email protected]> wrote in
message
news:f1vm39$s9d$[email protected]..
> Is there a way to change the font/color of alternative
text? Or is this
> all part of the user browser specifications?
>
> Thanks! -
Change font colour in Text Field
If I have typed 'The Cat Sat On The Mat' into a text field yet I want 'The Cat' to appear in bold and the rest as normal, how can I do this or even in a different colour?
Any help would be appreciatedThe only way to do this, is a text field that you change from plain text to rich text.
Then you can enter what you want, press ctrl+b to make something bold.
If you want to see the content of your box, use TextField.value.exData.saveXML() ... -
Change font color shifts text in Acrobat XI PRO
When I go into an acrobat document and try to chnage the font color, it shifts the text and the paragraph it's in. I contacted Adobe about it a few months ago and they told me it was a know bug.
When is it going to be fixed?Since this is a user-to-user forum, we don't have access to that type of information.
-
Can we apply embedded font in extension to a text layer of Photoshop ?
Hi All,
I have embedded some fonts into my Flex extension panel of Photoshop.
Can I apply these fonts to any text layer?
Kindly help URGENTLY!
Thanks,
D.AHere are 3 options for future reference:
1. With the setup you've described, apply a Match Move behavior to the text and make the rectangle the source. Change the Transform parameter to Mimic source. This way you can still adjust the text postion as needed, but the rectangle will drive the animation.
2. Use a group to do the animation. Put both your rectangle and text in the same group and animate the group's postion.
3. Use the Link behavior.
Each of these has it's advantages depending on what you need.
Maybe you are looking for
-
Which file do I open to install Firefox on windows 2000 after I download it?
I download the program, unzip it. There is no install or exe file in the folder. Which file starts the installation?
-
DAC - Mark as completed - From Command Line?
I have a exec plan which has around 50 tasks... This exec plan starts when a source file is posted in source file folder. We have a .bat file which checks for source file, once it find the file, it starts exec plan. .bat runs in loop, so once file is
-
Cannot select HD destination!!
I recently inherited a Mac mini from my late grandfather's estate. It had a ton of his personal info on it and I didn't want it to potentially fall into the wrong hands so I erased the volume. I used the OEM 10.3 OS X install disc and then used the D
-
FIELD BSEG-XREF3 - how to show it in transaction KSB1
Is it possible to see the field BSEG-XREF3 (reference field 3) in the transaction KSB1? Thanks and regards, Rino
-
Hi, While selecting records in table control only one record is selected. I want to edit mulitple records in table control. Can anybody gives me suggestions. Regards, Laxmi.