Set font size based on component size

Hi everybody,
This is kind of a duplicate, kind of new, because my original post is buried and I figured out a more helpful and general way to ask this question. Does anyone know if there is a way to set the size of a string as large as possible on a component, but still be able to have the whole string visible, if you're using a font other than default?
For example:
public static void main( String args[] ){
try {
          JFrame frame = new JFrame( "Title" );
          frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
          int guiWidth = width / 2;
          int guiHeight = height / 2;
          frame.setSize( guiWidth, guiHeight );
          Container pane = frame.getContentPane();
          // Create main label
          String labelString = "Test";
          JLabel label = new JLabel( labelString );
          label.setBackground( new Color( 179, 0, 0 ) );
          label.setForeground( new Color( 235, 191, 16 ) );
          label.setHorizontalAlignment( CENTER );
          label.setOpaque( true );
          label.setFont( new Font( �Old English Text MT�, 0, 48 ) );
          pane.add( label, BorderLayout.NORTH );
          frame.setLocationRelativeTo( null );
          frame.setVisible( true );
} catch( Exception e) {
e.printStackTrace();
     }As you can see, right now the font needs to be hard coded. I'd like it to be dynamic, based on the size of the screen the user has.
Sorry if the partial double post annoys anybody; I figured it would be less annoying than resurrecting my old post.
Any help on this would be great, and thank you!
Jezzica85
Message was edited by:
jezzica85
Message was edited by:
jezzica85

import java.awt.*;
import java.awt.event.*;
import java.awt.font.*;
import java.awt.geom.AffineTransform;
import javax.swing.*;
public class DynamicFont {
    private JLabel getNorth() {
        // Create main label
        String labelString = "Test";
        final JLabel label = new JLabel( labelString ) {
            public void paint(Graphics g) {
                ((Graphics2D)g).setRenderingHint(
                        RenderingHints.KEY_TEXT_ANTIALIASING,
                        RenderingHints.VALUE_TEXT_ANTIALIAS_ON);
                super.paint(g);
        label.setBackground( new Color( 179, 0, 0 ) );
        label.setForeground( new Color( 235, 191, 16 ) );
        label.setHorizontalAlignment( JLabel.CENTER );
        label.setOpaque( true );
        label.setFont( new Font( "Old English Text MT", 0, 48 ) );
        label.addComponentListener(new ComponentAdapter() {
            Font font = label.getFont();
            public void componentResized(ComponentEvent e) {
                int w = label.getWidth();
                int sw = label.getFontMetrics(font).stringWidth(label.getText());
                double scale = (double)w/sw;
                AffineTransform at = AffineTransform.getScaleInstance(scale, 1.0);
                label.setFont(font.deriveFont(at));
                label.repaint();
        return label;
    public static void main( String[] args ) {
        JFrame frame = new JFrame( "Title" );
        frame.setDefaultCloseOperation( JFrame.EXIT_ON_CLOSE );
        Container pane = frame.getContentPane();
        pane.add( new DynamicFont().getNorth(), BorderLayout.NORTH );
        frame.setSize( 400, 100);
        frame.setLocationRelativeTo( null );
        frame.setVisible( true );
}

Similar Messages

  • Set font size for ChoiceGroup

    Hi,
    Is there any way to set font size of the String elements of ChoiceGroup

    Hi,
    Yes, there is, but only if you're using MIDP2.0.
    Check the API documentation of ChoiceGroup and see that there's a setFont(.., ..) method. The given index (int value) identifies the index of the element in the list for which the font will be set. This means that different elements in one choicegroup can have different fonts.
    Test it carefully, I've noticed that not all devices show correct behaviour on this. Also note that certain devices ignore certain font settings (for example italics, because a lot of native implementations won't have a font in italics).
    Good luck!

  • How can I set font size of a column of Multicolumn Listbox at one time in edit mode?

    HI,
    I want to creat a Multicolumn Listbox with different font size in diffrent columns.
    But  I can only modify all cells or one cell font size at one time!
    How can I do?
    THANKS!

    My labview version is 7.1.
    I can't open the .vi you deliver.
    And in LV7.1, I can't  find  fontsize setting in property node.
    thank you all the same!
    Attachments:
    1111.JPG ‏27 KB

  • How to set Fonts size in X (whole system)

    Hi,
    I just bought a 19" monitor, and finally, got my resolution up from 800x600 to find out that i cant get to increse the xterm, Eterm, Firefox, Thunderbird, Gaim and everything to have an acceptable font size...
    I mean, is there a way to set the whole system font to some minimal size?
    I know how to change in almost every app (have to see if they can remember it, but thats just checking) but there are some i dont... xterm for example...ive looked at the man page, but there are so many options (just with the font subject, i do use several of the other flags) that i couldnt find the one i wanted, just to increase the font size... in Eterm there are 4 pre-set sizes, although i would like to increse it a bit more...
    I use Enlightenment, so i dont have any Gnome/KDE control center to do anything...
    As usual, any tips are welcome!
    Thanks!

    I can't provide much help but I can give you a hint: change the DPI globally with... one sec... xfce has some sort of script for settings the DPI globally...
    This is the part where the DPI is set
    # Those are my settings, change them as appropriate...
    # Xft DPI: 96
    # Xft.hintstyle: hintnone/hintslight/hintmedium/hintfull
    # Xft hinting: 1/0
    xrdb -nocpp -merge - << EOF
    Xft.dpi: 96
    Xft.hinting: 1
    Xft.hintstyle: hintmedium
    EOF
    You might run the command with another DPI setting...
    xrdb can be found in /usr/X11R6/bin.
    Once again, this is just a thought, I don't know how successful this change will be. Good luck.
    You might want to have a look on Google.
    IceRAM

  • Forms API, does set font size work?

    i call code as below:
    num = 8;
    d2fitms_font_siz(ctx, itm1, num);                    
    num = -1;
    d2fitmg_font_siz(ctx, itm1, &num);
    printf("num = %d ", num);     
    which verifies that the font size was, in fact, set to 8. however when i open my canvas in the layout editor, it appears as zero. all other changes to itm1 seem to work properly.
    do i need to set anything else, or is there a place i can check to see if this feature is broken?
    thanks,
    -james

    /* Copyright (c) Oracle Corporation 1996.  All Rights Reserved. */
       NAME
        D2FFNT.H -- Dev2K Forms API FoNT declarations
       DESCRIPTION
        Contains the public declarations for the Forms API FoNT support
       PUBLIC FUNCTIONS
        d2ffntcr_Create          - Cover for d2fobcr_Create
        d2ffntde_Destroy         - Cover for d2fobde_Destroy
        d2ffntdu_Duplicate       - Cover for d2fobdu_Duplicate
        d2ffntex_Extract         - Extract font info from object into font object
        d2ffntap_Applyl          - Apply font info from font object into object
        d2ffntg?_Get*Prop        - Cover for d2fobg?_Get*Prop
        d2ffnts?_Set*Prop        - Cover for d2fobs?_Set*Prop
        d2ffnthp_HasProp         - Cover for d2fobhp_HasProp
    #ifndef D2FFNT
    #define D2FFNT
    #ifndef ORATYPES
    # include <oratypes.h>
    #endif
    #ifndef D2FPRIV
    # include <d2fpriv.h>
    # endif
    /* C++ Support */
    #ifdef __cplusplus
    extern "C"
    #endif
    ** Object: Coordinate Info
    ** d2ffntex_Extract - Extract the font object from an object that
    **                    has font properties associated with it.  The
    **                    vat_typ argument is one of the D2FC_VATY_*
    **                    constants.  The font object must already have
    **                    been created.
    ** d2ffntap_Apply   - Apply the contents of the font object to the
    **                    specified object.  This is a shortcut to
    **                    setting the individual font properties one-
    **                    by-one.
    ORA_RETTYPE(d2fstatus) d2ffntcr_Create( d2fctx *pd2fctx, d2ffnt **ppd2ffnt );
    ORA_RETTYPE(d2fstatus) d2ffntde_Destroy( d2fctx *pd2fctx, d2ffnt *pd2ffnt );
    ORA_RETTYPE(d2fstatus) d2ffntdu_Duplicate( d2fctx *pd2fctx,
                                               d2ffnt *pd2ffnt_src,
                                               d2ffnt **ppd2ffnt_dst );
    ORA_RETTYPE(d2fstatus) d2ffntex_Extract( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                             d2fob *pd2fob, number vat_typ );
    ORA_RETTYPE(d2fstatus) d2ffntap_Apply( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                           d2fob *pd2fob, number vat_typ );
    ORA_RETTYPE(d2fstatus) d2ffntgb_GetBoolProp( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                                 ub2 pnum, boolean *pprp );
    ORA_RETTYPE(d2fstatus) d2ffntgn_GetNumProp( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                                ub2 pnum, number *pprp );
    ORA_RETTYPE(d2fstatus) d2ffntgt_GetTextProp( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                                 ub2 pnum, text **pprp );
    ORA_RETTYPE(d2fstatus) d2ffntgo_GetObjProp( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                                ub2 pnum, dvoid **pprp );
    ORA_RETTYPE(d2fstatus) d2ffntgp_GetBlobProp( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                                ub2 pnum, dvoid **pprp );
    ORA_RETTYPE(d2fstatus) d2ffntsb_SetBoolProp( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                                 ub2 pnum, boolean prp );
    ORA_RETTYPE(d2fstatus) d2ffntsn_SetNumProp( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                                ub2 pnum, number prp );
    ORA_RETTYPE(d2fstatus) d2ffntst_SetTextProp( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                                 ub2 pnum, text *prp );
    ORA_RETTYPE(d2fstatus) d2ffntso_SetObjProp( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                                ub2 pnum, dvoid *prp );
    ORA_RETTYPE(d2fstatus) d2ffntsp_SetBlobProp( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                                ub2 pnum, dvoid *prp );
    ORA_RETTYPE(d2fstatus) d2ffnthp_HasProp( d2fctx *pd2fctx, d2ffnt *pd2ffnt,
                                             ub2 pnum );
    /* Begin convenience macros  */
    #define d2ffntg_font_nam(ctx,obj,val) \
               d2ffntgt_GetTextProp(ctx,obj,D2FP_FONT_NAM,val)
    #define d2ffntg_font_siz(ctx,obj,val) \
               d2ffntgn_GetNumProp(ctx,obj,D2FP_FONT_SIZ,val)
    #define d2ffntg_font_spcing(ctx,obj,val) \
               d2ffntgn_GetNumProp(ctx,obj,D2FP_FONT_SPCING,val)
    #define d2ffntg_font_sty(ctx,obj,val) \
               d2ffntgn_GetNumProp(ctx,obj,D2FP_FONT_STY,val)
    #define d2ffntg_font_wght(ctx,obj,val) \
               d2ffntgn_GetNumProp(ctx,obj,D2FP_FONT_WGHT,val)
    #define d2ffnts_font_nam(ctx,obj,val) \
               d2ffntst_SetTextProp(ctx,obj,D2FP_FONT_NAM,val)
    #define d2ffnts_font_siz(ctx,obj,val) \
               d2ffntsn_SetNumProp(ctx,obj,D2FP_FONT_SIZ,val)
    #define d2ffnts_font_spcing(ctx,obj,val) \
               d2ffntsn_SetNumProp(ctx,obj,D2FP_FONT_SPCING,val)
    #define d2ffnts_font_sty(ctx,obj,val) \
               d2ffntsn_SetNumProp(ctx,obj,D2FP_FONT_STY,val)
    #define d2ffnts_font_wght(ctx,obj,val) \
               d2ffntsn_SetNumProp(ctx,obj,D2FP_FONT_WGHT,val)
    /* End convenience macros  */
    /* C++ Support */
    #ifdef __cplusplus
    #endif
    #endif /* D2FFNT */

  • Setting font size?

    Hi,
    1) Setting the font size in Safari>Preferences>Appearance appears to be useless. Safari Help says the font size setting there only applies to web pages that don't set their own font size, which appears to be 0% of the web pages I visit.
    2) Setting the minimum font size in Safari>Preferences>Advanced by checking Universal Access and specifying a minimum font size works, but the results are not very good. If I set the font size to 18, which is not unreasonably big, then text on different lines overlaps, and there are other more minor problems with some text escaping borders.
    3) Clicking on View>Make Text Bigger (or more convenient: dragging a font icon onto the toolbar and clicking that with the mouse) works almost perfectly. Even when you increase the text size many times and make the font size much bigger than 18, the text on different lines doesn't overlap. Everything on the page appears to increases in size proportionally. Unfortunately, with this method you have to click on Make Text Bigger every time you launch Safari.
    Why can't the minimum font setting in Universal Access (described in 2 above) do the same thing as Make Text Bigger? I also wonder why Safari's default is such tiny text? I would imagine the demographic for Apple user's is older than pc users, and yet you don't see such tiny default settings in IE.
    After trying 2) for a few days, I can't stand it anymore, so I've resorted to clicking on the Make Text Bigger icon I dragged onto my toolbar (View>Customize Address Bar).

    CSS is getting in the way of your Safari preferences
    and no way to get around it.
    I'm wondering how that can be? When I use Firefox or IE6 on a pc, I don't have to click on a Make Text Bigger icon every time I launch a browser window. If Safari can render the page with a bigger font size after I click a button, then Safari should be able to do the same thing by reading a setting.
    Simple fix?
    Command-+ to enlarge
    Command-- to reduce
    I don't use keyboard shortcuts. I find them bothersome.

  • How to set font size...

    Hi, I'm trying to make the font size of a link 16px, how can I do this? I am trying:
    Currently, I have:
    <b><hbj:link
    id="link1"
    text="Link to google"
    reference="http://www.google.com"
    target="_TOP"
    tooltip="this takes you to: http://www.google.com"
    onClick="LinkClick">
    <% link1.setFontSize(LinkFontSize.STANDARD);%>
    </hbj:link></b>
    But I would like the size of the font link to be 16px.
    I see that there is a constructor available in the JavaDocs but it is protected, how would I be able to use it?
    I'm a beginner in JSP and Java, so any examples, code, or suggestions are greatly appreciated!
    Thanks so much!
    Baggett.

    You can't use the LinkFontSize to change the font size but you have an alternative. you could do the following. You can pass your text for your link in html text and set the encoding to false.
    <b><hbj:link
    id="link1"
    text="<h1>Link to google</h1>"
    reference="http://www.google.com"
    target="_TOP"
    tooltip="this takes you to: http://www.google.com"
    onClick="LinkClick">
    <% link1.getInnerText().setEncode(false);%>
    </hbj:link></b>
    PS: Please Post your question in one forum.

  • Setting font size for code view

    On my 19" desktop monitor the text size in code view is easy enough to read, but on my hi resolution 17" laptop it is really, really tiny. I can't find any prefs setting or another way to make the font for code view larger. Is there such a setting somewhere? (Yes, I can change the resolution settings for the laptop but this is not preferable because the screen is blurry at anything other than the native 1920 x 1200 pixels.) Thanks.

    Play around with the preferences shown above to see what works for you.  I changed mine recently to use Consalas font and it's much better than the default  :-)
    Nadia
    Adobe® Community Expert : Dreamweaver
    http://www.perrelink.com.au
    Unique CSS Templates |Tutorials |SEO Articles
    http://www.DreamweaverResources.com
    http://csstemplates.com.au/
    http://twitter.com/nadiap

  • I need help to set font size in mail os x 10.9?

    Just upgraded to os x 10.9 and mail messages display at a very small font and can not be expanded by spreading fingers on screen as was the method prior to upgrade. Have thus far not found a way to change the default size. Would appreciate any help.

    No computer that runs Mac OS X 10.9 can change the size of things on screen by touching the screen -- the screens are not touch sensitive.
    Those settings are in Mail > Preferences > Fonts & Colors

  • Print Module - Set Explicit Font Sizes

    In the Print Module Identity Plate can Lightroom set font size explicitly instead of using only a % scale factor?
    The scale factor is a great idea but it would be a lot more convenient at times to set the font size explicitly to 10 or 12 or whatever so it could carry over to other titles if you want all your titles to print in a specific font size (e.g. 12 points). That's already possible with Vibrance, Recovery and a host of other settings (including the Identity Plate scale factor itself!) and it's very valuable to be able to have those exacting controls.
    Thanks,
    Robert

    Ian,
    I'd be very pleased if I'm doing something wrong. From what I see the Identity Plate supports only one font size, and only for the most recent photo. When I choose Edit and type in a new title of a different length Lightroom changes the size of the font (the longer the title, the smaller the font and vice versa). Try this:
    1) Open Identity Plate and title the picture "Hello".
    2) Change the title to "I just love Adobe Lightroom so very much!"
    The title will be smaller. Lightroom seems to disregard the Identity Plate font size.
    I just tried your recommendation and no matter how I changed the Identity Plate font size in the Print module (e.g. from 38pt to 8pt) the photo's title text size barely changes, I have to use the Scaling slider every time. That font sizing functionality only works for me in the Library module when I'm creating my actual Identity Plate.
    Every time I change pictures I have to re-do this step. The way I'm dealing with this is changing the scaling factor (or with your recommendation, the font size) every time for every different-length title and/or enlarging/shrinking the title box for each photo.
    As I explained in my other reply to your other post, this is very time-consuming when you're printing 50-100 titled photos in a single day/weekend (not to mention the fact that it's physically impossible to set every scaling factor so all titles print exactly the same size font).
    It would be a lot better for Lightroom to automatically save all the print parameters the way it saves all other of the picture's metadata.
    If you could share an easy way to make that much faster I'd be quite grateful.
    Robert

  • 10.8, Messages- Set my font size grayed out

    On 10.8 I can increse the font of incoming messages- but not the size of my font.
    It's microscopic. I set the window on my macbook- with it as a secondary monitor-
    and I can't read what I'm typing in Helvetica 12.
    Suggestions? I've tried setting font size in Safari, I've looked through System preferences- and of course in Messages preference.
    and btw- Apple- I think you blew it changing the name from iChat which searched great- to messages- which applies to every error message known to man and anything else. Distinctive name iChat was much easier to find info on.

    Change your background colour from Automatic to anything else and then you can change your font:

  • Help! How do i change jTable Font Size

    Hi,
    I want to change the all table column text font size except first column.
    Please see the code which i wrote but it is giving errors.
    //set font size
    Table.font(family=Dialog,name=Dialog,style=plain,size=12);
    Please any solution.
    Thanks in Advance
    sangeeta
    Here are the errors given below.
    C:\JSRC\MIGD>javac Table2.java
    Table_celera2.java:145: cannot resolve symbol
    symbol : variable family
    location: class Table2
    Table.font(family=Dialog,name=Dialog,style=plain,size=12);
    ^
    Table_celera2.java:145: cannot resolve symbol
    symbol : variable Dialog
    location: class Table2
    Table.font(family=Dialog,name=Dialog,style=plain,size=12);
    ^
    Table_celera2.java:145: name has private access in java.awt.Component
    Table.font(family=Dialog,name=Dialog,style=plain,size=12);
    ^
    Table_celera2.java:145: cannot resolve symbol
    symbol : variable Dialog
    location: class Table2
    Table.font(family=Dialog,name=Dialog,style=plain,size=12);
    ^
    Table_celera2.java:145: cannot resolve symbol
    symbol : variable style
    location: class Table2
    Table.font(family=Dialog,name=Dialog,style=plain,size=12);
    ^
    Table_celera2.java:145: cannot resolve symbol
    symbol : variable plain
    location: class Table2
    Table.font(family=Dialog,name=Dialog,style=plain,size=12);
    ^
    Table_celera2.java:145: cannot resolve symbol
    symbol : variable size
    location: class Table2
    Table.font(family=Dialog,name=Dialog,style=plain,size=12);
    ^
    7 errors
    C:\JSRC\MIGD>

    hi ma1evolance
    Thank you very much for your prompt reply.
    But when i run i got some errors please check. and give some good suggessions.
    I compile this program please see below
    public class FontRenderer extends DefaultTableCellRenderer implements TableCellRenderer
    //change them to whatever you like
    java.awt.Font font1 = new java.awt.Font("Dialog",1,12);
    java.awt.Font font2 = new java.awt.Font("Dialog",1,10);
    public FontRenderer()
    setFont(jTable1.getFont());
    public java.awt.Component getTableCellRendererComponent(JTable table, Object value, boolean isSelected, boolean hasFocus, int row, int column)
    java.awt.Component c = super.getTableCellRendererComponent(table,value,isSelected,hasFocus, row, column);
    //check for First Column
    if(table.convertIndexToModel(column) == 0)
    this.setFont(font1); //or whatever font you want
    else
    this.setFont(font2); //or this.setFont(table.getFont());
    return c;
    When I compile the above program then I got these errors. Please check this.
    C:\JSRC>javac FontRenderer.java
    FontRenderer.java:1: cannot resolve symbol
    symbol : class DefaultTableCellRenderer
    location: class FontRenderer
    public class FontRenderer extends DefaultTableCellRenderer implements TableCellR
    enderer
    ^
    FontRenderer.java:1: cannot resolve symbol
    symbol : class TableCellRenderer
    location: class FontRenderer
    public class FontRenderer extends DefaultTableCellRenderer implements TableCellR
    enderer
    ^
    FontRenderer.java:12: cannot resolve symbol
    symbol : class JTable
    location: class FontRenderer
    public java.awt.Component getTableCellRendererComponent(JTable table, Ob
    ject value, boolean isSelected, boolean hasFocus, int row, int column)
    ^
    FontRenderer.java:9: cannot resolve symbol
    symbol : variable jTable1
    location: class FontRenderer
    setFont(jTable1.getFont());
    ^
    FontRenderer.java:14: cannot resolve symbol
    symbol : variable super
    location: class FontRenderer
    java.awt.Component c = super.getTableCellRendererComponent(table,v
    alue,isSelected,hasFocus, row, column);
    ^
    FontRenderer.java:18: cannot resolve symbol
    symbol : method setFont (java.awt.Font)
    location: class FontRenderer
    this.setFont(font1); //or whatever font you want
    ^
    FontRenderer.java:20: cannot resolve symbol
    symbol : method setFont (java.awt.Font)
    location: class FontRenderer
    this.setFont(font2); //or this.setFont(table.getFont());
    ^
    7 errors
    C:\JSRC>

  • Printing--Linewrap/Metadata/Font-size?

    Running Lightroom 1.2 on WindowsXP.
    Three questions about printing:
    1) Is is possible to wrap lines in the Identity Plate? Ideally, I would like to force a hard line break between Name and Location or Name and Date, such as:
    Yosemite National Park
    2005
    and keep both lines centered within the Identity Plate field.
    2) Can Lightroom store print metadata (font size/color, scaling factor) for each print the way it stores Vibrance, virtual copies, tone curves, etc.?
    Suppose Photo1 and Photo2 have widely different title lengths (6 letters and 20 letters, respectively). Then I print Photo1 then Photo2 then Photo1 again. Right now I have to re-scale the letters for Photo1 to make them look the same size they were before, even though I printed Photo1 already. That's a real time-waster. Is there a better method when you cannot know which photo will be required to print next?
    3) Can Lightroom set font size explicitly instead of using % scale factor? It would be a lot more convenient to set the font size at 10 or 12 or whatever so it could carry over to other titles if you want all your titles to print in a specific font size (e.g. 12 points)
    Thanks,
    Robert

    Thanks. Sorry. I typically don't repeat questions.....
    Any guidance on my other 2 questions above?
    Robert

  • How do I change font size from points into pixels?

    I used to be able to set font size in points but CS 6 has removed this? Please dont say that points = pixels. They do not. See for yourself.  A photoshop doc and an Indesign doc have the same pixel size. A 20 point character "A" in InDesign, will be larger than a 20 pixel character "A" in photoshop. This creates hours of extra work when translating text heavy InDesign documents into Photoshop PSDs. Is there any workaround? Help!

    Ok, I know why you dont understand my question. I should have said, that points in InDesign do not equal pixels in HTML  (and I should have left Photoshop out of it). 
    My problem is going directly from InDesign to HTML CSS code. I used to be able to look at the type in my layout sketch in InDesign, select pixels in the units preferences and (assuming I am using the same webfont thanks to google fonts and the @fontface style) the font size would match exactly when I view the webpage in a browser. But now, when I try to code my webpage fonts in pixels, using the value from InDesign's points, fonts sizes dont match when viewed in borwser. This may seem like I am splitting hairs to you but it makes a big difference if I can just look at my InDesign sketch and see the excact size of the type without having to export a tracing/guide image and try to match visually. It just worked when I could see font size in pixles in InDesign in CS 5.5 but does not work in CS 6.
    Try a test: make a div in webpage with same pixel size as an InDeisgn doc. Use a defualt font like helvetic that is aval. to both InDesign and your browser. A 20 point word will not match a 20 pixel word in the same font.
    Also: I believe I rulled out any font replacment issues. For my designes, I am using the same font in both the InDesign doc and webpage code. I am using google fonts (donloaded for indesign and "link href" in head of code on webpage and/or using the @fontface style).

  • Change he font size in html

    Hello
    how do i cange the font size of the
    <td>#CurrentRow#</td>
    <Td>#CASE_NBR#</td>
    <td>#dateformat(CRTN_DT,"mm/dd/yyyy")#</td>
    to bold and size arial 10?
    and how do i change the font size:
    <th>Record Number</th>
    <th width="120">Case Number</th>
    <TH>Creation Date</TH>
    to to bold and size arial 8?
    or smaller than what it currently displaying?
    also is there a better way?
    thanks
    <cfquery name="getCityWideCases" datasource="cts9i">
    SELECT
    --PROP.STR_NBR
    --,PROP.STR_FRAC_NBR
    --,PROP.STR_FRAC_NBR_RNG_END
    --,PROP.STR_DIR_CD
    PROP.STR_NM
    --,PROP.STR_SFX_CD
    --,PROP.STR_SFX_DIR_CD
    --,PROP.STR_UNIT_TYP_CD
    --,PROP.UNIT_NBR
    --,PROP.PROP_ID
    --,PROP.ZIP_CD
    ,CASE.CASE_NBR
    --,CASE.CASE_ID
    --,CASE.CASE_TYP_CD
    ,CASE.CRTN_DT
    --,APLC.PROJ_DESC_TXT
    --,TYP.CASE_TYP_DESC
    FROM
    CTS.TLA_PROP PROP
    ,CTS.TLOC L
    ,CTS.TCASE CASE
    --,CTS.TAPLC APLC
    --,CTS.TREF_CASE_TYP TYP
    WHERE
    PLAN_AREA_NBR = '1'
    AND L.LOC_ID = PROP.PROP_ID
    AND CASE.APLC_ID = L.APLC_ID
    AND PROP.STR_NM != 'TEST'
    --AND CASE.PARNT_CASE_ID IS NULL
    ORDER BY
    <cfswitch expression="#Form.orderBy#">
    <cfcase value="CASENUMBER">
    CASE.CASE_NBR
    </cfcase>
    <cfcase value="CREATIONDATE">
    CASE.CRTN_DT
    </cfcase>
    </cfswitch>
    </cfquery>
    <!---html report--->
    <cfswitch expression="#Form.outputFormat#">
    <cfcase value="HTML,PDF">
    <cfsavecontent variable="htmlData">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Citywide Cases Report</title>
    </head>
    <style type="text/css">
    td{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    th{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    font-weight:bold;
    background-color:#FFFF99;
    h2{
    font-family:Arial, Helvetica, sans-serif;
    font-size:14px;
    h3{
    font-family:Arial, Helvetica, sans-serif;
    font-size:15px;
    </style>
    <body>
    <cfoutput>
    <table border="0" cellpadding="3" cellspacing="0">
    <tr>
    <td align="center">
    <h3>Citywide Cases
    Report</h3><br><br></td>
    </tr>
    <tr>
    <td align="center">
    </h2>Your query returned #getCityWideCases.RecordCount#
    records</h2></td>
    </tr>
    <tr>
    <td>
    <table border="2" cellpadding="2" cellspacing="0">
    <tr>
    <th>Record Number</th>
    <th width="120">Case Number</th>
    <TH>Creation Date</TH>
    </tr>
    <cfloop query="getCityWideCases">
    <tr bgcolor="<cfif currentrow mod
    2>GHOSTWHITE<cfelse>WHITE</cfif>">
    <td>#CurrentRow#</td>
    <Td>#CASE_NBR#</td>
    <td>#dateformat(CRTN_DT,"mm/dd/yyyy")#</td>
    </tr>
    </cfloop>
    </table>
    </td>
    </tr>
    </table>
    </BODY>
    </HTML>
    </cfoutput>
    </cfsavecontent>
    <cfswitch expression="#Form.outputFormat#">
    <cfcase value="HTML">
    <cfoutput>
    #htmldata#
    </cfoutput>
    </cfcase>
    <cfcase value="PDF">
    PDF
    <cfdocument format="pdf">
    <cfoutput>
    #htmldata#
    </cfoutput>
    </cfdocument>
    </cfcase>
    </cfswitch>
    </cfcase>
    <cfcase value="CSV">
    <CFHEADER NAME="Content-Disposition" VALUE="attachment;
    filename=citywide.csv">
    <cfcontent type="application/msexcel">"Case
    Number","Creation Date"
    <cfoutput
    query="getCityWideCases">#ltrim(CASE_NBR)#,"#dateformat(CRTN_DT,"mm/dd/yyyy")#"
    </cfoutput>
    <cfabort>
    </cfcase>
    </cfswitch>
    <cfquery name="getCityWideCases" datasource="cts9i">
    SELECT
    --PROP.STR_NBR
    --,PROP.STR_FRAC_NBR
    --,PROP.STR_FRAC_NBR_RNG_END
    --,PROP.STR_DIR_CD
    PROP.STR_NM
    --,PROP.STR_SFX_CD
    --,PROP.STR_SFX_DIR_CD
    --,PROP.STR_UNIT_TYP_CD
    --,PROP.UNIT_NBR
    --,PROP.PROP_ID
    --,PROP.ZIP_CD
    ,CASE.CASE_NBR
    --,CASE.CASE_ID
    --,CASE.CASE_TYP_CD
    ,CASE.CRTN_DT
    --,APLC.PROJ_DESC_TXT
    --,TYP.CASE_TYP_DESC
    FROM
    CTS.TLA_PROP PROP
    ,CTS.TLOC L
    ,CTS.TCASE CASE
    --,CTS.TAPLC APLC
    --,CTS.TREF_CASE_TYP TYP
    WHERE
    PLAN_AREA_NBR = '1'
    AND L.LOC_ID = PROP.PROP_ID
    AND CASE.APLC_ID = L.APLC_ID
    AND PROP.STR_NM != 'TEST'
    --AND CASE.PARNT_CASE_ID IS NULL
    ORDER BY
    <cfswitch expression="#Form.orderBy#">
    <cfcase value="CASENUMBER">
    CASE.CASE_NBR
    </cfcase>
    <cfcase value="CREATIONDATE">
    CASE.CRTN_DT
    </cfcase>
    </cfswitch>
    </cfquery>
    <!---html report--->
    <cfswitch expression="#Form.outputFormat#">
    <cfcase value="HTML,PDF">
    <cfsavecontent variable="htmlData">
    <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0
    Transitional//EN" "
    http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
    <html xmlns="
    http://www.w3.org/1999/xhtml">
    <head>
    <meta http-equiv="Content-Type" content="text/html;
    charset=iso-8859-1" />
    <title>Citywide Cases Report</title>
    </head>
    <style type="text/css">
    td{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    th{
    font-family:Arial, Helvetica, sans-serif;
    font-size:12px;
    font-weight:bold;
    background-color:#FFFF99;
    h2{
    font-family:Arial, Helvetica, sans-serif;
    font-size:14px;
    h3{
    font-family:Arial, Helvetica, sans-serif;
    font-size:15px;
    </style>
    <body>
    <cfoutput>
    <table border="0" cellpadding="3" cellspacing="0">
    <tr>
    <td align="center">
    <h3>Citywide Cases
    Report</h3><br><br></td>
    </tr>
    <tr>
    <td align="center">
    </h2>Your query returned #getCityWideCases.RecordCount#
    records</h2></td>
    </tr>
    <tr>
    <td>
    <table border="2" cellpadding="2" cellspacing="0">
    <tr>
    <th>Record Number</th>
    <th width="120">Case Number</th>
    <TH>Creation Date</TH>
    </tr>
    <cfloop query="getCityWideCases">
    <tr bgcolor="<cfif currentrow mod
    2>GHOSTWHITE<cfelse>WHITE</cfif>">
    <td>#CurrentRow#</td>
    <Td>#CASE_NBR#</td>
    <td>#dateformat(CRTN_DT,"mm/dd/yyyy")#</td>
    </tr>
    </cfloop>
    </table>
    </td>
    </tr>
    </table>
    </BODY>
    </HTML>
    </cfoutput>
    </cfsavecontent>
    <cfswitch expression="#Form.outputFormat#">
    <cfcase value="HTML">
    <cfoutput>
    #htmldata#
    </cfoutput>
    </cfcase>
    <cfcase value="PDF">
    PDF
    <cfdocument format="pdf">
    <cfoutput>
    #htmldata#
    </cfoutput>
    </cfdocument>
    </cfcase>
    </cfswitch>
    </cfcase>
    <cfcase value="CSV">
    <CFHEADER NAME="Content-Disposition" VALUE="attachment;
    filename=citywide.csv">
    <cfcontent type="application/msexcel">"Case
    Number","Creation Date"
    <cfoutput
    query="getCityWideCases">#ltrim(CASE_NBR)#,"#dateformat(CRTN_DT,"mm/dd/yyyy")#"
    </cfoutput>
    <cfabort>
    </cfcase>
    </cfswitch>

    For the mail app specifically, you can't. You can set font size for the system overall in accessiblity (Settings app > General > Accessibility > Large Text), but this will not impact some emails (such as those using graphics).

Maybe you are looking for

  • I can no longer synchronise my settings

    Today I made some important changes to the settings in Photoshop. When I tried to synchronise my settings to CC so I could synchronise the changes with Photoshop on my laptop, I found that nothing happened (the last sync was on 31 January this year).

  • Compilation Errors "skipp incompatible" installing oracle 10g on linux 64z9

    Hello Friends, I have errors while installing Oracle 10g 10.2.0 for z9 Systems on a IBM Z/OS System with a SLES 10 Linux for z9 (64bit System). The Problem: Some programs of oracle cause errors while compiling libraries. The Error: ------------ With

  • Dimension processing error: "duplicate id detected"

    Hi All, Im facing an issue where when i try to process a dimension, i get an error message ."error while processing dimensions" "duplicate id detected" .The reason for this is there are two identical id's with in the same dimension. "pu" & "PU". Im n

  • HT201210 Help!

    I'm trying to update my iPhone 4 software to iOS7. When I tried to udate, however, it told me I did not have enough storage. So I deleted over 500 photos, 150 contacts, and about 8 apps. It still wouldn't let me, so I got onto my desktop and connecte

  • Unable to Download to FireFox3

    Loaded the new FireFox3 browser and have been unsuccessfully trying to download Flash. The message I have is "close FireFox application". If I close FireFox then the program will not load ON FireFox???? Everything works fine on IE, but want to use Fl