Reading TrueType Font character widths including kerning

Okay, here it is: Since getStringBounds() and stringWidth() deliver incredible unprecise values and Sun apparently doesn't really care to fix this, I need to read the kerning information of a true type font manually.
What I have is a field that is formatted as "width is 3.5cm" and its content is "Yo folks, this rocks" or something like that. What I need to do now is to measure whether the text (the content) really matches the field's size (3.5cm) or needs to be wrapped or cut.
getStringBounds() and stringWidth() simply delivers crap as results, since Sun's rasterizer apparently completely ignores the kerning information and simply counts the character widths together (see: http://forum.java.sun.com/thread.jsp?forum=20&thread=421610).
So, does anyone have a clue on how to read TTF fonts directly and measure a font using the information that is already contained in the TTF file? And please, I know that Sun's rasterizer is system independant, but that' doesn't help me any single bit and waiting for Sun to perfect their rasterizer is out of question as well.
I shall award the author of the best clue or hint into the right direction (hey, after all, maybe I oversaw something (nope, setting KEY_FRACTIONALMETRICS doesn't count, that still returns the wrong results, although they're better and more precise than without them <g>)) with ten Duke bucks.
Thanks a lot (and sorry for the language)

I have a starnge feeling that this may be partly to do with the size
of the font you are using. For Ariel plain I got the following size
10 point=     374
This is the actaul width of the text (in pixels) as displayed.
My monitor is 78.818 dpi. so converting this to 72 dpi = 341.65
at 96 dpi this is 455.5.
The following code was used (It shows the mouse position)
import java.awt.*;
import java.awt.event.*;
import javax.swing.*;
import javax.swing.text.*;
public class Fonts extends JFrame{
  private static final String text =
"abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ1234567890";
  JTextPane jtf;
  StyledDocument doc;
  public Fonts(int pSize) {
    super();
    doc = new DefaultStyledDocument();
    jtf =new JTextPane(doc);
    jtf.setText(text);
    Font f = new Font("Ariel",Font.PLAIN,pSize);
    jtf.setFont(f);
    getContentPane().add(jtf);
    jtf.addMouseMotionListener(new MouseMotionAdapter(){
        public void mouseMoved(MouseEvent me) {
          System.out.println(me.getX()+" "+getY());
    setSize(800,600);
  public JTextPane getTextPane() {
    return jtf;
  public static void main(String[] args) {
     Fonts f = null;
     try {
       f = new Fonts(Integer.parseInt(args[0]));
       f.setVisible(true);
     }catch(Exception e) {
        System.out.println("Please enter a valid point size");
        System.exit(1);
    try{
     Rectangle start = f.getTextPane().modelToView(0);
     Rectangle end = f.getTextPane().modelToView(text.length());
     System.out.println("point size "+args[0]+"\t"+(end.getX()-start.getX()));
    }catch(Exception e) {
      e.printStackTrace();
}matfud

Similar Messages

  • Font Character Width How ?

    I have a text area and need to place a guide at a certain
    character offset but don't know how to calculate the pixel width
    that text will occupy. The text is not typed yet; I need to place
    the guide before any text is input. I use a fixed width font only
    (courier). Any suggestions ?

    I am using Text Layout Framework 2. I have drawn text field using TextFlow and container controller.

  • Fixed character width font

    Hi All,
    1.
    In SAPScript i m using the font
    ANDALE_J Size 8
    This font is NOT 'Proportionate Spacing'
    ie. It is fixed character width font
    as per the definition.
    2.
    In preview, the alignment of data
    &field1(35)& &field2(15)&  &field3(25)
    is seen perfectly OK.
    (multiple rows in detail data)
    3.
    But when printout is taken, the
    data is not printed as per alignment
    seen on the screen.
    Can anybody guide & help.
    Regards,
    Amit Mittal.

    This means that the font you are using is not available for the device type used by the output device (printer) you are using.
    Check transaction se73.
    Select Printer fonts -> Display -> double click on the device type for the output device you are using and verify if the font family <b>ANDALE_J</b> size <b>080</b> is listed.
    If it is not, use one that is available or ask the system admin to install the font for the device type and in some cases on the printer as well.
    Rishi

  • Fixed layout ePub not display truetype font properly when uploaded to Amazon

    I've created a kids book with inDesign CC which works fine on iPad but when I upload the book to Amazon KDP, the font which is a truetype font and not protected doesn't display properly. It has unusual spacing between the charaters and sometimes the letters overlap each other.  Can i embed this font somehow to have it display properly? I can't find an option anywhere to do that. Or will I have to change the font entirely?  Many thanks.

    Hi Yves,
    Yes, it is an SIL license. I am not using Allatuq anymore, I switched to Quicksand which I got from fontsquirrel.com.
    Yes, there is a fixed layout epub option in inDesign CC 2014:
    It even has some default sizing options though I have gone with a custom size to account for larger devices, desktop reading etc and am hoping that it's going to work.
    The Kindle previewer (desktop version) displays perfectly.
    The online previewer has had some display issues with what looks like drop shadows on some images but i'll need to look at the actual file on multiple devices to see what the reality is.
    There are some inconsistencies between how the fonts look in the previewers. The online one is not perfect and the desktop previewer displays exactly as designed so again, I won't really know until I can get my hands on the devices. There is also a sizing issue with the online previewer that the desktop previewer doesn't seem to have. And then there will be the issue that the "purchase" file isn't consistent with the preview file you download so not sure how it will all pan out yet.
    I had lots of overlapping and other character spacing issues until I changed my font to the OTF Quicksand with the SIL License. I'm hoping the drop shadows are just an issue with the online previewer.
    And I'm hoping my conclusion is correct that the OTF with the SIL licenses work for embedding so long as you remove the encryption and replace the encrypted font with the orignal version (and include the license). And I'm hoping that is allowed.

  • Custom report - Can't customize font / table width etc

    So i'm authoring my first report - that works fine; however I can't seem to figure out how to customize the font / table width etc. I'm creating an RDL file from Report Server Project Wizard in Visual Studio and in there i'm changing font sizes and table
    widths and I can see its changing in the RDL file's XML. I then plug the RDL file into my managment pack and import it. I run the report and the results always have this huge font and the table widths don't change. Anyone have any idea what i'm missing or
    why that would be happening? heres the RDL file for reference:
    <Report xmlns="http://schemas.microsoft.com/sqlserver/reporting/2008/01/reportdefinition" xmlns:rd="http://schemas.microsoft.com/SQLServer/reporting/reportdesigner">
    <Body>
    <ReportItems>
    <Textbox Name="textbox1">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>Report1</Value>
    <Style>
    <FontFamily>Tahoma</FontFamily>
    <FontSize>12pt</FontSize>
    <FontWeight>Bold</FontWeight>
    <Color>SteelBlue</Color>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>textbox1</rd:DefaultName>
    <Height>0.36in</Height>
    <Width>5in</Width>
    <Style>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    <Tablix Name="table1">
    <TablixBody>
    <TablixColumns>
    <TablixColumn>
    <Width>1in</Width>
    </TablixColumn>
    <TablixColumn>
    <Width>2.75in</Width>
    </TablixColumn>
    <TablixColumn>
    <Width>3.58333in</Width>
    </TablixColumn>
    </TablixColumns>
    <TablixRows>
    <TablixRow>
    <Height>0.22in</Height>
    <TablixCells>
    <TablixCell>
    <CellContents>
    <Textbox Name="textbox2">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>Raised Date Time</Value>
    <Style>
    <FontFamily>Tahoma</FontFamily>
    <FontSize>6pt</FontSize>
    <FontWeight>Bold</FontWeight>
    <Color>White</Color>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>textbox2</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <BackgroundColor>SteelBlue</BackgroundColor>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCell>
    <TablixCell>
    <CellContents>
    <Textbox Name="textbox3">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>Alert Name</Value>
    <Style>
    <FontFamily>Tahoma</FontFamily>
    <FontSize>6pt</FontSize>
    <FontWeight>Bold</FontWeight>
    <Color>White</Color>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>textbox3</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <BackgroundColor>SteelBlue</BackgroundColor>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCell>
    <TablixCell>
    <CellContents>
    <Textbox Name="textbox4">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>Alert Description</Value>
    <Style>
    <FontFamily>Tahoma</FontFamily>
    <FontSize>6pt</FontSize>
    <FontWeight>Bold</FontWeight>
    <Color>White</Color>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>textbox4</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <BackgroundColor>SteelBlue</BackgroundColor>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCell>
    </TablixCells>
    </TablixRow>
    <TablixRow>
    <Height>0.21in</Height>
    <TablixCells>
    <TablixCell>
    <CellContents>
    <Textbox Name="RaisedDateTime">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=Fields!RaisedDateTime.Value</Value>
    <Style>
    <FontFamily>Tahoma</FontFamily>
    <FontSize>5pt</FontSize>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>RaisedDateTime</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCell>
    <TablixCell>
    <CellContents>
    <Textbox Name="AlertName">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=Fields!AlertName.Value</Value>
    <Style>
    <FontFamily>Tahoma</FontFamily>
    <FontSize>5pt</FontSize>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>AlertName</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCell>
    <TablixCell>
    <CellContents>
    <Textbox Name="AlertDescription">
    <CanGrow>true</CanGrow>
    <KeepTogether>true</KeepTogether>
    <Paragraphs>
    <Paragraph>
    <TextRuns>
    <TextRun>
    <Value>=Fields!AlertDescription.Value</Value>
    <Style>
    <FontFamily>Tahoma</FontFamily>
    <FontSize>5pt</FontSize>
    </Style>
    </TextRun>
    </TextRuns>
    <Style />
    </Paragraph>
    </Paragraphs>
    <rd:DefaultName>AlertDescription</rd:DefaultName>
    <Style>
    <Border>
    <Color>LightGrey</Color>
    <Style>Solid</Style>
    </Border>
    <PaddingLeft>2pt</PaddingLeft>
    <PaddingRight>2pt</PaddingRight>
    <PaddingTop>2pt</PaddingTop>
    <PaddingBottom>2pt</PaddingBottom>
    </Style>
    </Textbox>
    </CellContents>
    </TablixCell>
    </TablixCells>
    </TablixRow>
    </TablixRows>
    </TablixBody>
    <TablixColumnHierarchy>
    <TablixMembers>
    <TablixMember />
    <TablixMember />
    <TablixMember />
    </TablixMembers>
    </TablixColumnHierarchy>
    <TablixRowHierarchy>
    <TablixMembers>
    <TablixMember>
    <KeepWithGroup>After</KeepWithGroup>
    <RepeatOnNewPage>true</RepeatOnNewPage>
    <KeepTogether>true</KeepTogether>
    </TablixMember>
    <TablixMember>
    <Group Name="table1_Details_Group">
    <DataElementName>Detail</DataElementName>
    </Group>
    <TablixMembers>
    <TablixMember />
    </TablixMembers>
    <DataElementName>Detail_Collection</DataElementName>
    <DataElementOutput>Output</DataElementOutput>
    <KeepTogether>true</KeepTogether>
    </TablixMember>
    </TablixMembers>
    </TablixRowHierarchy>
    <DataSetName>DataSet1</DataSetName>
    <Top>0.36in</Top>
    <Height>0.43in</Height>
    <Width>7.33333in</Width>
    <ZIndex>1</ZIndex>
    <Style />
    </Tablix>
    </ReportItems>
    <Height>0.79in</Height>
    <Style />
    </Body>
    <Width>8.1875in</Width>
    <Page>
    <LeftMargin>1in</LeftMargin>
    <RightMargin>1in</RightMargin>
    <TopMargin>1in</TopMargin>
    <BottomMargin>1in</BottomMargin>
    <Style />
    </Page>
    <AutoRefresh>0</AutoRefresh>
    <DataSources>
    <DataSources>
    <DataSource Name="DataWarehouseMain">
    <DataSourceReference>Data Warehouse Main</DataSourceReference>
    <rd:DataSourceID>e4235c51-407f-4065-8519-a1e57374bc45</rd:DataSourceID>
    </DataSource>
    </DataSources>
    </DataSources>
    <DataSets>
    <DataSet Name="DataSet1">
    <Query>
    <DataSourceName>DataWarehouseMain</DataSourceName>
    <QueryParameters>
    <QueryParameter Name="@AlertName">
    <Value>=Parameters!AlertName.Value</Value>
    </QueryParameter>
    <QueryParameter Name="@StartDate">
    <Value>=Parameters!StartDate.Value</Value>
    </QueryParameter>
    <QueryParameter Name="@EndDate">
    <Value>=Parameters!EndDate.Value</Value>
    </QueryParameter>
    <QueryParameter Name="@ObjectName">
    <Value>=Parameters!ObjectName.Value</Value>
    <rd:UserDefined>true</rd:UserDefined>
    </QueryParameter>
    </QueryParameters>
    <CommandText>SELECT dbo.vManagedEntity.FullName,
    dbo.vManagedEntity.TopLevelHostManagedEntityRowId,
    dbo.vManagedEntity.ManagedEntityRowId,
    Alert.vAlert.ManagedEntityRowId,
    Alert.vAlert.AlertName,
    Alert.vAlert.AlertDescription,
    Alert.vAlert.RaisedDateTime
    FROM dbo.vManagedEntity
    INNER JOIN Alert.vAlert
    ON dbo.vManagedEntity.ManagedEntityRowId = Alert.vAlert.ManagedEntityRowId
    WHERE dbo.vManagedEntity.FullName LIKE '%' + @ObjectName + '%'
    AND Alert.vAlert.AlertName LIKE '%' + @AlertName + '%'
    AND Alert.vAlert.RaisedDateTime &gt;= @StartDate
    AND Alert.vAlert.RaisedDateTime &lt;= @EndDate
    ORDER BY Alert.vAlert.RaisedDateTime DESC</CommandText>
    <rd:UseGenericDesigner>true</rd:UseGenericDesigner>
    </Query>
    <Fields>
    <Field Name="AlertName">
    <DataField>AlertName</DataField>
    <rd:TypeName>System.String</rd:TypeName>
    </Field>
    <Field Name="AlertDescription">
    <DataField>AlertDescription</DataField>
    <rd:TypeName>System.String</rd:TypeName>
    </Field>
    <Field Name="RaisedDateTime">
    <DataField>RaisedDateTime</DataField>
    <rd:TypeName>System.DateTime</rd:TypeName>
    </Field>
    <Field Name="ObjectName">
    <DataField>ObjectName</DataField>
    <rd:UserDefined>true</rd:UserDefined>
    </Field>
    </Fields>
    </DataSet>
    </DataSets>
    <ReportParameters>
    <ReportParameter Name="AlertName">
    <DataType>String</DataType>
    <Prompt>Alert Name</Prompt>
    </ReportParameter>
    <ReportParameter Name="StartDate">
    <DataType>DateTime</DataType>
    <Prompt>Start Date</Prompt>
    </ReportParameter>
    <ReportParameter Name="EndDate">
    <DataType>DateTime</DataType>
    <Prompt>End Date</Prompt>
    </ReportParameter>
    <ReportParameter Name="ObjectName">
    <DataType>String</DataType>
    <Prompt>Object Name</Prompt>
    </ReportParameter>
    </ReportParameters>
    <Language>en-US</Language>
    <ConsumeContainerWhitespace>true</ConsumeContainerWhitespace>
    <rd:ReportUnitType>Inch</rd:ReportUnitType>
    <rd:ReportID>4250ddf1-3c87-47b1-b8c2-314aad86ad86</rd:ReportID>
    </Report>
    Any suggestions would be greatly appreciated. Thanks!

    I did some digging and found a link that might help you/have an answer.
    http://stackoverflow.com/questions/14850503/change-default-font-ssrs-visual-studio
    https://connect.microsoft.com/SQLServer/feedback/details/574003/modify-the-default-font-family-for-sql-server-business-intelligence-development-studio-while-creating-a-report#
    If you click on work around someone posted that they were able to modify the default font in visual studio.
    "If I am not mistaken, you can update your Report.rdl template file in visual studio
    to use the default font you wish to use.
    navigate to this location (where x is your visual studio version):
    C:-\Program Files\Microsoft Visual Studio x\Common7\ide\PrivateAssemblies\ProjectItems\ReportProject
    copy report.rdl to an already created report project. 
    Add the report to your report project
    Update the default font where applicable.
    Copy the updated report.rdl back to the location above and that is it.
    The next time you open your project, you will be using the update rdl file as your
    template. 
    You can do this as many times as you want.
    Use this link as a reference
    http://weblogs.sqlteam.com/jhermiz/archive/2007/08/14/60283.aspx
    Cheers,
    Martin
    Blog:
    http://sustaslog.wordpress.com 
    LinkedIn:
    Note: Posts are provided “AS IS” without warranty of any kind, either expressed or implied, including but not limited to the implied warranties of merchantability and/or fitness for a particular purpose.

  • Chinese and Japanese font / character still cannot display in AIR 13.0 or 14.0.0.103, Android 4.4.2

    Hi there,
    Chinese and Japanese font / character still cannot display in AIR 13.0 or 14.0.0.103 , Android 4.4.2
    Korean font is OK.
    Any ideas??
    Thanks!
    Contra

    Could you please open a new bug report on this over at bugbase.adobe.com?  When adding the bug, please include sample code or an application so we can quickly test this out internally.  If you'd like to keep this private, feel free to email the attachment to me directly ([email protected]). 
    Once added, please post back with the URL so that others affected can add their comments and votes. I can also follow up once I get the bug number.

  • Embedding Truetype fonts into PDF Document

    Hi all,
    I have a question for you :
    I have a class in VB6 to make my PDF documents,
    with this class i have the possibility to enter text of
    Type 1 and text of Truetype fonts in the PDF Document,
    by the specifications of the font:
    i.e.:
    to be able to enter text in Regular Times New Roman, I must to provide these specifications :
    an array with the widths of all the characters, precisely :
    Array(250, 333, 408, 500, 500, 833, 778, 180, 333, 333, 500, 564, 250, 333, 250, 278, 500, 500, 500, 500, 500, 500, 500, 500, 500, 500, 278, 278, 564, 564, 564, 444, 921, 722, 667, 667, 722, 611, 556, 722, 722, 333, 389, 722, 611, 889, 722, 722, 556, 722, 667, 556, 611, 722, 722, 944, 722, 722, 611, 333, 278, 333, 469, 500, _
                         333, 444, 500, 444, 500, 444, 333, 500, 500, 278, 278, 500, 278, 778, 500, 500, 500, 500, 333, 389, 278, 500, 500, 722, 500, 500, 444, 480, 200, 480, 541, 778, 500, 778, 333, 500, 444, 1000, 500, 500, 333, 1000, 556, 333, 889, 778, 611, 778, 778, 333, 333, 444, 444, 350, 500, 1000, 333, 980, 389, 333, 722, 778, 444, 722, _
                         250, 333, 500, 500, 500, 500, 200, 500, 333, 760, 276, 500, 564, 333, 760, 500, 400, 549, 300, 300, 333, 576, 453, 250, 333, 300, 310, 500, 750, 750, 750, 444, 722, 722, 722, 722, 722, 722, 889, 667, 611, 611, 611, 611, 333, 333, 333, 333, 722, 722, 722, 722, 722, 722, 722, 564, 722, 722, 722, 722, 722, 722, 556, 500, _
                         444, 444, 444, 444, 444, 444, 667, 444, 444, 444, 444, 444, 278, 278, 278, 278, 500, 500, 500, 500, 500, 500, 500, 549, 500, 500, 500, 500, 500, 500, 500, 500)
    And some parameters :
    /Flags 34
    /FontBBox [-250 -216 1200 1000]
    /MissingWidth 333
    /StemV 73
    /StemH 73
    /ItalicAngle 0
    /CapHeight 891
    /XHeight 446
    /Ascent 891
    /Descent -216
    /Leading 149
    /MaxWidth 1000
    /AvgWidth 401
    The question : Where I can find these specifications for other truetype fonts, like Tahoma, MS Sans Serif ecc..?
    thanks in advance for any replies!

    Thank you for replication,
    could you show me the name of API that I should use ?
    thanks in advance for any replies!

  • Character widths in JTextPane

    Hello everybody
    I write a WYSIWYG Report-Editor. My Problem is that the character-widths in the Editor is different to the Output (rtf,pdf).
    For Exaple in the Editor i can write 45 w's (Arial,plain,11) in one Line an in the Output is was 57. With Times New Roman i can write 64 ant in the Output is possible to set only 57 in one line.
    So i have write an own BoxView for the TextPane and set int the paint method "g2D.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON)" The result is that the characterwitds are identic to the output but the caretpositions in the editor are wrong.
    Then i try to set putProperty("i18n", Boolean.TRUE) in the document. The result is that the characterwidts are equals the the version without fractionalmetrics->ON.
    What can i do?
    Thanks Thomas

    Thank You for the tip
    I overwrites the getFontMetrics Method in the JTextPane
    @Override
    public FontMetrics getFontMetrics(Font font) {
    Graphics graphics = getGraphics();
    Graphics2D g2d = (Graphics2D) graphics;
    if(g2d == null){
    return super.getFontMetrics(font);
    g2d.setRenderingHint(RenderingHints.KEY_FRACTIONALMETRICS,RenderingHints.VALUE_FRACTIONALMETRICS_ON);
    return g2d.getFontMetrics(font);
    It works!

  • Embed TrueType Font not working

    I've tried for several hours to use a embedded font without
    succes.
    I have:
    <mx:Script>
    <![CDATA[[
    Embed(source="work/ttf/KIMSHAND.TTF", fontName="KIMSHAND",
    mimeType="application/x-font")]
    private var fontKIMSHAND:Class;
    ]]>
    </mx:Script>
    <mx:Text
    id="helpText"
    height="240"
    width="240"
    text="My help text"
    fontSize="24" color="#ffffff" fontFamily="KIMSHAND">
    </mx:Text>
    The .text isn't displayed when I run the project.
    I've trief a lot of other truetype fonts, but none are
    working.
    I'm using Flex 2.0.1 on OSX.
    Thanks for help!
    Jaap

    The easiest/cleanest way to embed fonts is in css code, try
    the following:
    <mx:Style>
    @font-face {
    src:url("work/ttf/KIMSHAND.TTF");
    fontFamily: myFont;
    flashType: true;
    .MyStyle {
    fontFamily: myFont;
    fontSize: 24;
    </mx:Style>
    <mx:Label styleName="MyStyle" text="HELLO WORLD"/>

  • How to convert a logo in truetype font?

    Is there a freeware or shareware program which can convert a logo in truetype font?
    I saw Fontographer, but it's very expensive...

    mnstudio
    There are many tools out there that can do the job for you. Fontographer is one of them, but there is also Fontlab Studio or Glyphs (http://glyphsapp.com) which looks very promising and is a lot cheaper than the other two.
    Fortunately there is also FontForge (FontForge.org) which is an open source font editing tool. The good thing about FontForge is that it is free, the bad thing about FontForge is that it is very complicated to get it up and running because they only provide sourve packages, no installers. But you can always search the net for a version with an installer, but these versions are mostly very outdated.
    As far as I know, FontForge is the only free tool out there, so you might try it.

  • IBooks Author TrueType font problem

    I'm working on an iBook and I'm attempting to use a truetype font for a page heading, but when I preview it on my iPad, the font shows up correctly for a brief moment, then is replaced by something generic. I have confirmed in the Font Book application that the font is a .ttf, and it DOES show up in the font selector drop down menu on the formatting bar in iBooks Author. Why would the font show up correctly for a second or two and then disappear on the iPad?

    It would appear that there's a bug in the preview mode. Maybe something to do with a cached version of the book? I fixed the problem by deleting the "proof" version on my iPad and re-sending it and now the truetype font shows up correctly.

  • ACROBAT 6 DISTILLER - TRUETYPE FONTS

    Okay so here goes....
    We use quark to save our quark files as .ps (postscript) files and drag those postscript files to the distiller to create pdf's. The problem is when i send these pdf's created from this mac to a pc and open it up and go under file--->document properties--->fonts, I am seeing TrueType Fonts, which i shouldn't be seeing. It is illegal to use TrueType fonts when your distributing pdf's online. I had a hard drive that is dying so i reloaded the os's (9&x) on a new drive. Everything seems to be setup correctly, but when i distill the .ps files from the old drive im not getting any TrueType fonts within the pdf??? It seems to be Helvetica & Times that are having a problem on the new drive, they always show up as TrueType and on both drives im using Helvita & Times in the same location. ~/system/library/fonts/ Anybody that can help me i would gladly appreciate it.

    That sounds like Adobe trying to sell you more fonts. The striped red letter A is simply Adobe's icon for any printer outline portion of a Type 1 PostScript font. But there's plenty of other vendors of PostScript fonts that of course won't have that icon. Doesn't make them any less usable.
    There's also no law or rule against using TrueType fonts if you want. Although it does depend on what you're doing with the resulting PDF. If your PDF is going to a professional printer, then you should use PostScript fonts. Most professional RIP's still don't handle TrueType fonts well. The edges of characters look like they were cut out quickly with a scissors on the final files used to create film or plates for press. But if your PDF documents are just being distributed for viewing and garden variety printing from a laser or inkjet printers, there's absolutely no reason you can't use a TrueType font.

  • 10.1.13 version won't read Din font family

    I am using the 10.1.13 version of Acrobat Reader to view a PDF and and am unable to view the Din font family.
    Error message reads: "Cannot extract the embedded font 'ADVOMU+DIN-Light'. Some characters may not display or print correctly."
    Any resolutions?

    We have this same problem when we use our Vector Works drawing program; we use the DIN font which is a postscript Type 1 font. Then, when we export the file as a pdf, the font does not display in Acrobat 10.1.13; when you open the file, you get this message: "Cannot extract the embedded font 'ZUJFJJ + DIN_Regular'. Some characters may not display or print correctly". and there is no text visible (other fonts or parts of the lay-out do show, though).
    - so, it seems to occur only with DIN fonts
    - the problem doesn't occur in version 10.1.12, only in 10.1.13
    - and it also doesn't when we use DIN truetype font
    I see various posts on forums concerning this problem, and i assume that these problems occur with different programs that generate pdf's. Using truetype seems to be a solution, but then we need to substitute all our texts in older documents with the truetype font.
    So: should we change our font sets from postscript type 1 to truetype?

  • What Fonts are in Adobe Reader XI Font Packs - Asian and Extended Language Pack?

    I have been unsuccessful in determining what fonts are included in the "Adobe Reader XI Font Packs - Asian and Extended Language Pack".
    Is there a description link or a way to determine from within Reader?
    Thanks

    Adobe Reader XI Font Packs - Asian and Extended Language Pack
    http://www.adobe.com/support/downloads/detail.jsp?ftpID=5508

  • Set TrueType font as Default

    We have uploaded a new font (Verdana) via se73 (Install TrueType Fonts) and made an entry in the table TBTFFONTMAP. Now in the CRM Interaction Center when creating a new email or replying to an existing email we are able to choose this new font. However we would like to set this font as a default, so that whenever you create a new email or answer an email per default it takes this Verdana font. So far we have only seen the possibility to change the Internet Settings (Internet Options -> Lettertypes/ Fonts). However if we change the settings here we are not able to choose the size of the font, so it takes the size (size 12) of the current default which is Times New Roman and this is too big for Verdana.
    Has anyone found out already how to change the default font of the email editor?
    Many thanks in advance!
    Best regards,
    Bianca

    Sorry for the late response,
    I started again with a fresh install of Windows Vista and again the same problem appears.
    So to resume:
    Open a new package
    Go to the registry menu.
    Add manually (with several right clicks New-> key) the following tree:
    HKLM\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Print\Printers\Adobe PDF
    Drag the "Default DevMode" binary value (REG_BINARY) from my computer into the "Adobe PDF" key of the destination computer.
    Save the project
    Click on the Summary button crashed the wizard
    In my opinion it is the REG_BINARY string length that cause the problem, I try with other long binary value from other key and it always give the same result -> Wizard crash. I also try with small binary value and these don't gives the problem (for example the "HKCU\Control Panel\Appearance\SchemeLangID" has a small value 09 04 and doesn't give the wizard crash).
    Other thing with the binary value is that you can only create empty one, they cannot be modified, so you are obliged to install acrobat pro in order to be able to drag them from my computer to destination computer registry.
    I will try with acrobat X and the related wizard next week.

Maybe you are looking for