Font Attribute Trouble

I am experimenting with Font. Can anyone explain the difference between getting a Font's attributes and getting its available attributes? Here's the code and below it is the output.
import java.awt.*;
import java.awt.font.*;
import java.text.*;
import java.util.*;
public class test {
   public static void main(String[] args) {
      Font f=new Font("Arial",Font.PLAIN,12);
      Map map=f.getAttributes();
      map.put(TextAttribute.FOREGROUND,Color.red);
      Font f2=new Font(map);
      AttributedCharacterIterator.Attribute[] acia=f2.getAvailableAttributes();
      for(int i=0;i<acia.length;i++)
         System.out.println(acia);
System.out.println("\n");
Object[] keys=map.keySet().toArray();
for(int i=0;i<keys.length;i++)
System.out.println(keys[i]);
And the output is:
java.awt.font.TextAttribute(family)
java.awt.font.TextAttribute(weight)
java.awt.font.TextAttribute(posture)
java.awt.font.TextAttribute(size)
java.awt.font.TextAttribute(foreground)
java.awt.font.TextAttribute(transform)
java.awt.font.TextAttribute(family)
java.awt.font.TextAttribute(size)

In case anyone wants to know, the getAvailableAttributes() is a hard-coded method that returns an array of
TextAttribute.FAMILY,
TextAttribute.WEIGHT,
TextAttribute.POSTURE,
TextAttribute.SIZE

Similar Messages

  • Can I create default font attributes in mail like on the Mac?

    Is there any way to create default font attribute on the iPad for Mail specify, but anything else as well? I haven't been able to find a thing.
    Thanks,
    Darryl

    I guss you figured it out, but I already did the screen shots, so I'll post anyway.
    Once you have your simple font templates created, it's just 3 clicks and a select away ( okay 5 clicks total ).
    Here it is in screen shots:

  • Can I copy font attributes to many titles at once?

    Hi,
    I really like that CC has introduced the ability to create copies of a title on the timeline... but once you have many, many titles on the timeline is it possible to copy and paste font attributes from one title to all the others? I need to change the font size of about 100 titles and currently I need to open each one individually and change the setting. Any advice most appreciated, thanks

    I discovered a handy help for this problem. It isn't the feature you (or we) want but it is a help. I recently used the otherwise apparently useless Title Styles window in the Pr title tool to make my own "Style". I too needed to update a bunch of titles with a new font size.
    1. Change one Title to the style and size you want
    2. Use the menu for the Title Styles window (upper right of the Style Library window) to save style with "New Style..."
    the current style with all its attributes will appear at the end of the style library. Drag it up to the top of the list so you can click on it easily.
    3. Go to the next Title you want to change and ctrl click on the style you added to the library and chose "Apply Style with Font Size". (I don't know why this isn't the default when just clicking on the style in the library, but maybe that's just because of my needs)
    There is no "New Style Library" command so I went one step further and saved the Style Library under a new name, found the XML file in /Users/YourUserName/Documents/Adobe/Premiere Pro/7.0/Profile-CreativeCloud-/Styles/MyNew-workingset.prsl (using TextEdit-on a Mac)
    And deleted everything that didn't look like it belonged to the style I needed. Now I have a clean library. A lot of hoop jumping but...
    ...I hope this helps.

  • Set Font Attributes for Slide Show Captions

    PSE v.6 - When creating a slide show, I can select to "Include photo captions as text" when adding slides. The font of the included text is basic with no effects (I want it to have a drop shadow). Is there a way to set the default text attributes (color, font style, drop shadow, etc.) before adding the slides or change the text on all selected slides instead of having to do it one slide at a time?

    well you can add captions below the slide , if you double click on a slide and move it , it can move around , hence you can add a  caption below the slide by slightly moving up the image .

  • Rich text field will not show proper font attributes! (Bug? - RTF OTF font handling)

    I created two text form fields (rich text)...
    In Windows 7, Write program (using it to format the rich text content)... I edited my two lines.
    Line one: mix of two font sizes and a few attribute changes... pasted into the first text field perfectly.
    Line two: similar to the above... pasted into the second text field but the font is appearing in bold! It is not bold in the source, nor is it preset in the text field properties! I even pasted it back into Write AND Word and it pastes as I intended it.
    Why is Adobe doing this? I even tried to toggle >Text Style > bold on/off, clear formatting... these functions do not work!
    If I bring up the properties toolbar (Ctrl-E), bold is toggled on but I cannot toggle it off, I can add underline, I can change the font size.
    UPDATE: It seems that Adobe Acrobat is NOT reading the OTF font correctly! If I change to a different font, in the same family, the problem changes from set on bold to set on italics!
    It is specifically related to the font I am using but is ONLY a problem when using Rich Text fields. In other words, the entire font family works perfectly if I inserted a text box or use the font family in any other Adobe product.
    I have submitted a bug report: https://www.adobe.com/cfusion/mmform/index.cfm?name=wishform&loc=en

    Another possibly revealing clue is that when I go to Text Field Properties > Appearance tab > Text / Font, I see the entire family of this particular font. However, when editing the text in the properties toolbar (Ctrl-E), only a small sub-set of this font family appears and the attributes behave in an odd manner. Example: normal font appears as italics but if I switch on BOLD, the italic attribute is gone... and other strange attribute problems.

  • Fonts/attributes change between IC/ID

    We're using InCopy CS2 Version 4 on Macs running OS X 10.3.9. I set up a document of news briefs every week. I cut and paste the news items from e-mail into a new incx document. My new document includes the same style palette I use on all other new documents I generate. My other documents go through fine, with the style calls (i.e. font, type size etc.) matching on the InDesign end. However, this roundup document, always reads on the InDesign with all uppercase headlines. After I have saved the roundup, I have double-checked and my styles have not somehow changed to call for all uppercase heds. I have tried saving the cut and pasted text as plain text before pasting it into the incx file, but I get the same result. There is nothing that each week's document has in common with the previous week's, except that I cut and paste this text. Is that somehow throwing things off? Why can't I detect anything amiss on my end?
    Thanks.

    1/ Exactly Fred
    Here is the definitions of the aggregate:
    100139:
    0PLANT
    0STOR_LOC
    0MAT_PLANT__0VAL_CLASS
    0STOCKCAT
    0STOCKTYPE
    BMODIFIC
    BMVTSTOCK
    0MATL_TYPE
    0CALxxx
    2/ For my information in the aggregate 100140 , does the presence of BBATCH (one of the 3 IO) trigger the rebuilt or is it only 0MAT_PLANT__0VAL_CLASS ?
    100140:
    0PLANT
    0STOR_LOC
    0MATERIAL
    0MAT_PLANT__0VAL_CLASS
    BBATCH
    0STOCKCAT
    0STOCKTYPE
    BMODIFIC
    BMVTSTOCK
    0MATL_TYPE
    0CALxxx
    3/ In the same process chain, I have another Attributes Change Run: 0MATERIAL. Several active aggregates using 0MATERIAL__0MATL_TYPE are built on a CO-PA cube.
    Why did the '0MATERIAL Attributes Change Run' rebuild no aggregate? (see below)
    22:06:04     Job started
    22:06:04     Step 001 started (program RSPROCESS, variant &0000000231238, user ID RFC_BW)
    22:06:06     Activation of master data for 0MATERIAL
    22:06:07     154 Data records deleted
    22:06:11     154 Data records deleted
    22:06:12     154 Data records updated
    22:06:13     154 Data records updated
    22:06:13     0 aggregates are condensed
    22:06:14     Hierarchy/attribute change successfully carried out
    22:06:14     Event RSPROCESS with parameter D59BEEE069HKRCRU0ZPYFUPB1 successfully triggered
    22:06:14     Job finished
    Samuel

  • How to change font attributes on multiple paths at once?

    I am trying to change font size on multiple paths at once but as soon as I select them the font options become unavailable (greyed out).
    Is it possible to do it?

    Willi is essentially correct but I think his message is being drowned out by the allcaps enthusiasm
    If you select multiple paths with the Selection tool (the black arrow) then you cannot alter type formatting directly. Seasoned InDesign users rarely manipulate type by direct formatting; instead we apply a paragraph style to all of the type, and then change the paragraph style. If all the text on those paths was marked with the same paragraph style, then you could just change the style.
    You could do it other ways, but they're all suboptimal. For instance, if all of your text-on-path was set at 11 points, and no other type was set at 11 points anywhere in your document, you could use Find/Change to specify a Find Format and a Change Format under More Options. If all of the paths were marked with the same Object Style, then you could make a new Paragraph Style and specify it in the Object Style.
    But if you drew those paths by hand, then they have the Basic Graphics Frame object style applied (like everything else you drew in the document) and if you didn't style the text then every bit of text has the Basic Paragraph style applied (like every other bit of text in the document). So you're either going to do it by hand, or... you're going to follow Willi's allcaps advice.

  • Font attributes of a text element in a smartform

    Hi Folks,
    I have a text element in a smartform for whic I am using a Smartstyle to set the font size,style etc.
    In the text editor I have it like this-
    k1 Net Quantity:&itab-quantity&.
    k1 is the paragraph format I had declared in the smartstyle with fontsize 14.
    Net Quantity is hardcoded in the text editor.
    Now I want to set a different font size  only to the &itab-quantity&.How to achieve this.
    Thanks,
    K.Kiran.

    Hi Folks,
    Got the Solution,We can do it by declaring a character format with a different font size.
    k1 Net Quantity: <c1>&itab-maktx&</>
    c1 is the new character format with a font size that applied only to maktx if given the above way in the text editor.
    Thanks,
    K.Kiran.

  • Font Attributes

    Could someone please give me a simple code example(s) that would display a label in an applet
    with characteristics such as font type, bold, italics, underline, etc. applied?

    I tried the following code:
    //Create applet components
    Label lblHeader = new Label("Encore Movies", 1);
       lblHeader.setFont((new Font("dialog", Font.BOLD, 12)));I received the following errors:
    c:\mydocu~1\java2TDT>javac Movies.java
    Movies.java:37: <identifier> expected
    lblHeader.setFont((new Font("dialog", Font.BOLD, 12)));
    Movies.java:37: cannot resolve symbol
    symbol : class setFont
    location: package lblHeader
    lblHeader.setFont((new Font("dialog", Font.BOLD, 12)));

  • ADF11g: LOV for attribute trouble

    It seems that when I have specified an LOV for an attribute and made the Default List Type a Choice List, I am no longer able to use the attribute as an inputTextField in a JSF page.
    I have a page with an editable table, and the attribute with the LOV is an inputTextField like this:
    <af:column sortProperty="PageId" sortable="false"
                         headerText="#{bindings.PageImagesViewRW11.hints.PageId.label}">
                <af:inputText value="#{row.bindings.PageId.inputValue}"
                              label="#{bindings.PageImagesViewRW11.hints.PageId.label}"
                              required="#{bindings.PageImagesViewRW11.hints.PageId.mandatory}"
                              columns="#{bindings.PageImagesViewRW11.hints.PageId.displayWidth}"
                              maximumLength="#{bindings.PageImagesViewRW11.hints.PageId.precision}"
                              shortDesc="#{bindings.PageImagesViewRW11.hints.PageId.tooltip}">
                  <f:validator binding="#{row.bindings.PageId.validator}"/>
                  <af:convertNumber groupingUsed="false"
                                    pattern="#{bindings.PageImagesViewRW11.hints.PageId.format}"/>
                </af:inputText>
              </af:column>When I submit the page I get the following error:
    javax.faces.convert.ConverterException: Unable to resolve a Validator instance using either validatorId '' or binding '#{row.bindings.PageId.validator}'.Can anyone reproduce this?

    Yes it does work without the f:validator tag.
    Apparently I don't need it because the af:convertNumber will throw an error when I enter something other than a number.
    Still, I don't think this is how it's supposed to work. Should I create an SR for this?
    regards
    Wendy Tromp

  • How to copy font attributes?

    How can I copy fontcolor, size and type from one text to another in FCP?

    You can't. At least not if the text clips are already made.
    However, there was one product which claims to allow you to do that (and many other things): http://www.xmedit.com/
    -DH

  • Setting a font on a PSD text item in javascript?

    Hi there,
    I'm new to photoshop scripting and am having a bit of trouble editing a text layer in Photoshop using javascript.
    I have a few PSD templates in which I'd like to replace text on specific layers with javascript before generating hundreds of animated GIFs. I have placeholder text on the target layers and have been able to replace it with:
    "textItemRef.contents = "Hello, world";
    however this loses ALL text formatting. Is there a different way to replace existing text keeping sizes/colors/fonts in tact? All examples I can find create new layers needing all the attributes. I've tried assigning a paragraph style to the placeholder text using Photoshop cc 2014 stylesheets but that doesn't retain styles when the text is replaced, either.
    I also can't find mention of TEXT STYLESHEETS in the scripting guides or photoshop DOM references, presumably because they're so new? If anyone has been able to assign TEXT styles, what is the syntax? Or is there one for clearing overrides if that's possible?
    If the only way IS to style everything one attribute at a time, I am having problems with the font attribute. var myFont = app.fonts.getByName("Arial"); does not seem to work.

    A follow-up for anyone experiencing this dropped style on a layer when importing new content... it turns out using paragraph styles AT ALL on a layer will make that layer lose its style when new text is imported with javascript (for some reason photoshop then incorrectly assumes you want to reset the formatting of the new layer to the DEFAULT paragraph style). This is the complete opposite of the results you'd want to use stylesheets to attain in the first place. But, starting with a layer that has only been manually styled with the font menus and character menu items will hold its attributes when importing new text.
    I've recorded and copied below the ActionManager script happening behind the scenes when importing text, and all Photoshop does with the stylesheets because I've used a paragraph style:
    // =======================================================
    var idAdobeScriptAutomationScripts = stringIDToTypeID( "AdobeScriptAutomation Scripts" );
        var desc459 = new ActionDescriptor();
        var idjsCt = charIDToTypeID( "jsCt" );
        desc459.putPath( idjsCt, new File( "/Applications/Adobe Photoshop CC 2014/Presets/Scripts/one-text-line-to-hdln.jsx" ) );
        var idjsMs = charIDToTypeID( "jsMs" );
        desc459.putString( idjsMs, """this is text""" );
    executeAction( idAdobeScriptAutomationScripts, desc459, DialogModes.NO );
    // =======================================================
    var idsetd = charIDToTypeID( "setd" );
        var desc460 = new ActionDescriptor();
        var idnull = charIDToTypeID( "null" );
            var ref36 = new ActionReference();
            var idPrpr = charIDToTypeID( "Prpr" );
            var idparagraphStyle = stringIDToTypeID( "paragraphStyle" );
            ref36.putProperty( idPrpr, idparagraphStyle );
            var idTxLr = charIDToTypeID( "TxLr" );
            var idOrdn = charIDToTypeID( "Ordn" );
            var idTrgt = charIDToTypeID( "Trgt" );
            ref36.putEnumerated( idTxLr, idOrdn, idTrgt );
        desc460.putReference( idnull, ref36 );
        var idT = charIDToTypeID( "T   " );
            var desc461 = new ActionDescriptor();
            var idstyleSheetName = stringIDToTypeID( "styleSheetName" );
            desc461.putString( idstyleSheetName, """Basic Paragraph""" );
            var idtypeStyleOperationType = stringIDToTypeID( "typeStyleOperationType" );
            desc461.putInteger( idtypeStyleOperationType, 1 );
        var idparagraphStyle = stringIDToTypeID( "paragraphStyle" );
        desc460.putObject( idT, idparagraphStyle, desc461 );
    executeAction( idsetd, desc460, DialogModes.NO );
    Now the same actions with no style applied to the layer getting new text.

  • How do I change the font size of a data point label on a cfchart?

    I know I can control the x axis and y axis font with the font="" attribute of the cfchart tag.  But I want to change the font size of the data label in the chart series.  Is that possible?

    To specifically and fully answer your question, no, you absolutely cannot change the “font size” as a function of print.
    First of all, there isn't a single “font size” associated with a PDF file (and we assume you are referring to a PDF file since this is an Acrobat forum).
    Secondly, PDF is a final form file format meaning that the content is static in terms of location, size, etc. on the page. To change the point size of any particular text, you really need to go back to the source document and make the changes there.
              - Dov

  • How to print true type font in smartform with ECC6

    hi,expert:
    I want to use true type font "Comic Sans MS.ttf".
    I upload this font file by SE73 named ZTT2I.
    In SE73.. select the Radio button "Font Families" And click on the "True type Font Installation" button. click the font attribute ITALIC。
    Our print device is LP01 and driver is CNSAPWIN
    when I create a new style in smartform using the font ZTT, in preview window the font still like other font.
    Our system is IDES ECC6, SAP_BASIS SAPKB70014
    Now when I create smartfrom in language EN adn logon with language EN,it can print correct style of that font.
    But if the smartform is base on language ZH or logon with language ZH, the output is not correct.
    why? How to solve it?
    how can I solve this problem?
    thaks a lot

    Hi,
    Is the problem that uploaded true type font ZTT is not used when language is ZH? Did you update the chinese version of the style associated with the smartform? There is a separate style for each language version. So you need to log on in Chinese language and update the style with new paragraph, character formats. Then you need to activate the style and smartform for ZH langauge also.
    Regards,
    Aidan

  • How to use true type font in smartform with ECC6

    hi,expert:
    I want to use true type font "Comic Sans MS.ttf".
    I upload this font file by SE73 named ZTT2I.
    In SE73.. select the Radio button "Font Families" And click on the "True type Font Installation" button. click the font attribute ITALIC。
    Our print device is LP01 and driver is CNSAPWIN
    when I create a new style in smartform using the font ZTT, in preview window the font still like other font.
    Our system is ECC6, SAP_BASIS 700 level0017 packeg SAPKB70017
    how can I solve this problem?
    thaks a lot

    the ABAP forum administrator take this question to netweaver forum.
    Now when I create smartfrom in language EN,it can output correct style of that font.
    But if the smartform is base on language ZH, the output is not correct.
    why? How to solve it?
    thanks a lot

Maybe you are looking for