Fonts in Windows and Fonts in Java

Hello,
Say I have in my app:
String string = "\\u09A1";
I want to display this in my app. I can call:
GraphicsEnvironment.getLocalGraphicsEnvironment().getAllFonts();
I can then iterate through these and find out which ones can display this unicode character using,
font.canDisplayUpTo(string);
My question is, are these the fonts that Java can display (from charsets.jar) or the ones installed in Windows?
I would like to be able to get lists for both of these.
Any ideas?
Cheers,
Jim

Thank you. I did read that. I was not talking about drawing text in 'Hello World' alike applets/programs.
I should give an example:
I would like to print 'H' in Tahoma, 72, Bold (Windows format) at (100, 200).
Font sizes:
In Windows font size is 72 pixels.
In Java this is equal to 96 points (72 px * 96 (scr resolution for Toolkit) / 72 (pixels per point).
Real height in Windows and Java will be 64 px.
That's fine. For some fonts this does not work.
Positioning. See example above.
According to the article you refer to in java we should use y-coordinate 200 + 72 (font size) = 272.
In fact we have :
Java text 14 pixels below than expected.
Similar things happen to other parameters Weight, Styles, etc.
I do use AttributedString and TextAttribute classes to render text
Thanks in advance.
Alex

Similar Messages

  • HT1147 big windows and fonts on mac

    My screen changed, too big windows and too big fonts
    Resolution is good
    I remember there is a couple to keys to go back to the regular windows and fonts
    Thank you for your help

    Turn off Zoom from the Universal Access and Keyboard & Mouse panes of System Preferences.
    (66727)

  • Perform Hamming window and FFT with Java

    Hi all,
    I am trying to apply Hamming window on my lengthy sound data soundSample[1000] with window length 100. Then proceed with FFT.
    And i found that java does have the package for Hamming window and FFT. As below,
    http://code.compartmental.net/minim/javadoc/ddf/minim/analysis/FFT.html
    http://marf.sourceforge.net/api/marf/math/Algorithms.Hamming.html
    But i hardly find an example that illustrate how to use the package in a java program. So no idea how should i use the method in package.
    Please advise and appreciate if reference is provided.
    Thank you.

    Hi,
    I have spent sometimes to study and do the coding for FFT on audio samples.
    My project is to study the FFT working by performing the FFT on audio sampled data.
    After this is done, then only proceed to extract the pitch value in the audio data.
    Below is the coding that i have done by referring to the provided steps:
    In my main, i call this method and past the retrieved sampled sound data to this method.
    public static void Analyze(int[] soundSample,float sample_rate ) {
            int N = (int)sample_rate/5;
            int Number_Sample = soundSample.length;
            Complex[] fftBuffer = new Complex [2*N];
            Complex[] fftResult = new Complex [2*N];
            Complex [] lastN = new Complex [N];   // The array to save the last N sample
            int delay = 0;
            double delta = 2*Math.PI/(2*N);
            // I have no idea how can i convert my sample array to double so that it will be in the range of [-1,+1]
            while(delay <=soundSample.length){
                //Extract the 2N sample for FFT analysis and convert the data to complex number.
                for (int z=0; z<2*N; z++){
                    fftBuffer[z] = new Complex(soundSample[z+delay],0) ;                
                for (int i=N-1;i>=N/2; i-- ){
                    lastN[N-1-i] = fftBuffer;
    for (int z=0; z<2*N; z++){
    fftBuffer[z] = fftBuffer[z].times(0.54-0.46*Math.cos(z*delta));
    fftResult = FFT1.fft(fftBuffer);
    delay = 2*N + delay;
    1) I was trying to perform FFT with 2N samples then keep on looping the FFT method until 2N reaches the ends of sampled data.
    But the FFT that i am working with is radix 2... It doesn't work with my 2N samples... Please teach me how should i work out FFT regardless the number of sample?
    2) The hamming window coefficient i m using is based on http://www.mathworks.com/help/toolbox/signal/hamming.html . I am working on index [0:2N] ..
    Is it appropriate?
    3) According to your No1 steps, the acceptable frequency resolution is 5Hz. May i know what is this representing? And is it application for most of the FFT application? How can i determine the frequency resolution that i should used in my project?
    Sorry for late reply as i was trying to work out the thing..
    Hereby attach to your the my coding.. and hopes to have your guidance and tutorial how to extract the pitch for recording audio file with Java.
    I have done the pitch extraction with MATLAB.. but Matlab as built-in FFT function... 
    So i m now get stucked how to perform FFT on audio sound sample regardless the N value of sound sample for FFT buffer.
    Many thanks for your former advise... and
    Looking forward for your replies again.
    Happy New Year 2011 :)
    Edited by: 诸葛 on Dec 31, 2010 9:29 AM                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                       

  • Executing WINWORD from both Windows and linux using Java

    Dear All,
    I have a problem when trying to use Runtime class to execute a winword document. My code is as follows.
    Runtime r= Runtime.getRuntime();
    try{
    r.exec("rundll32"+" "+"url.dll,FileProtocolHandler"+" "+"WINWORD"+ " "+"file://C://welkom.doc");
    catch(Exception ex){
    System.out.println("Unable to open the doc file:"+ex);
    When I execute this swing application with the above, the program is unable to open the specific file. And it says "Problem with the short cut, unable to open the file". When I run the program without the file name, it opens a new doc file.
    Attn: what I want to do here is I need to open the winword file from both windows and linux. So I cannot use the relative path of the WINWORD.exe file.
    Can anyone help me?
    Thanks in advance.
    Regards,
    Bala

    If you take a look at the api, there's an exec(String[]) method. This is the one you should use when calling a command with multiple parameters.
    so something like...
    String[] cmd = new String[] {"rundll32", "url.dll,FileProtocolHandler", "WINWORD", "file://C://welkom.doc"}
    r.exec(cmd);

  • Custom Windows and Frames in Java - Help

    Hello, I'm begining a Java class in school and Ive been wondering how to get rid of these boring windows. For example I want to turn something like this:
    to something like this:
    I realize theyre 2 different programs. Im simply asking how I may draw and implement my own frames on windows along with background images/colors.
    Thanks in advance~

    Have a look at http://www-128.ibm.com/developerworks/java/library/j-iframe/ which allows you to override all of the decorations associated with frames.

  • Setting file permisions ,group permission on Windows and unix from java

    Hi
    i am trying to set up file permissions through java on unix and windows operation sysyem
    .I don't want to use shell scripts .
    thank you for your help.

    HI BIJ001,
    Thanks for reply.I am paling to use
    1)First i am detecting operating system
    2)if it is UNIX->calling unix scripts from JAVA
    2)if it is WINDOWS ->calling Bat scripts.
    But attrib command in windows does not support FIle Gropu permssion like unix(chmod 777 filename).
    Do yoou have any experience in .bat sctipts on file permission.
    Let me know .Again thank you for reply.

  • Install Font in Windows 7 with MDT

    I need to install company fonts in windows 7. I use MDT 2010 to install OS and my applications, this works great, but when I try to install fonts (the way I use to do for XP,...objFontsFolder.CopyHere FontName...) it just does not work. The fonts are not installed.
    How can I install a font using MDT in Windows 7
    Thanks
    Daryl

    yes create a windows and fonts folder
    yes I have done it under post install
    It better to store reg file in the deploymentshare because during installation it is not easy to run or access a reg file from a network share.
    Chris
    I made folder as suggested and copied fonts that I wanted to use with new win7 image but after I re-imaged one of out laptops I cant see that those fonts are actually copied/installed.
    Let me explain in steps what I did to avoid any confusion:
    1. made folder under deployment share D:\DeploymentShare\$OEM$\$1\Windows\Fonts and added 10 diff fonts
    2. added new tasksequence under post install (run command line) and added line regedit /s %SCRIPTROOT%\fonts.reg
    3. made fonts.reg and added it to D:\DeploymentShare\Scripts
    This is how fonts.reg looks like:
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
    "somefont1 (TrueType)"="somefont1.TTF"
    "somefont2 (TrueType)"="somefont2.TTF"
    and so on to nr 10...
    What am I doing wrong ?

  • PC Suite Image and Font Size

    Hi.The control panel for PC Suite is awfully small, and the fonts for the text are even smaller, down to what would be termed in the printer's trade as "granite" size.  When I need to Scroll, for example down to  my phone carrier to log in, or when I need to read the "Help" manual, I cant see what I need to read because the print is so ridiculously minisucule.  Will the Adminstrato4rs of Nokia/PC Suite please enlarge the command windows and fonts to a usefull and viisible size ??   Thanks.  Ringmeup2Scotty.

    hi mate,
    Nokia PC Suite development has stopped and the product is no longer actively supported. suggest migrating/using Nokia Suite instead, of which the latest version is available for download from http://nokia.com/nokiasuite
    As for the suggestion, you can leave such suggestions over at Nkoia BetaLabs under the Nokia Suite application page: http://betalabs.nokia.com

  • Pixelated font in windows tabs

    Hi, the font in the windows tabs is all pixelated in my
    freehand MXa...
    Here is a link with a printscreen of the problem....
    http://static.flickr.com/83/235438633_6890cba33f_o.jpg
    So... What is happening with my freehand??

    yes create a windows and fonts folder
    yes I have done it under post install
    It better to store reg file in the deploymentshare because during installation it is not easy to run or access a reg file from a network share.
    Chris
    I made folder as suggested and copied fonts that I wanted to use with new win7 image but after I re-imaged one of out laptops I cant see that those fonts are actually copied/installed.
    Let me explain in steps what I did to avoid any confusion:
    1. made folder under deployment share D:\DeploymentShare\$OEM$\$1\Windows\Fonts and added 10 diff fonts
    2. added new tasksequence under post install (run command line) and added line regedit /s %SCRIPTROOT%\fonts.reg
    3. made fonts.reg and added it to D:\DeploymentShare\Scripts
    This is how fonts.reg looks like:
    Windows Registry Editor Version 5.00
    [HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts]
    "somefont1 (TrueType)"="somefont1.TTF"
    "somefont2 (TrueType)"="somefont2.TTF"
    and so on to nr 10...
    What am I doing wrong ?

  • When a html coded page requires the Windows Symbol font, Firefox does not call it, and the English alphabet characters display instead. How can I get the Symbol font to work when the page is loaded in Firefox??

    ''duplicate of https://support.mozilla.com/en-US/questions/902677''
    This site shows Greek letters and Greek words by calling for the Windows Symbol font. The page(s) involved display correctly in Internet Explorer, but not in Firefox 3.6.1 or 8.1. In Firefox, the Greek letter does not appear, it is just replaced with the English letter for the equivalent keystroke. Here is a html line that ought to cause Symbol's Greek letter lowercase alpha to be displayed, but all you get is an "a" :
    (td width="60")(p align="center")(big)(strong)(font face="Symbol")(span style="font-family: , Symbol")a(/span)(/font)(/strong)(/big)(/td)
    **I have had to replace the left and right carets with left and right parentheses. Otherwise, the line actually executes, disappears, and just leaves a bolded "a" on the next line.***

    Reemphasizing, the page code works on Internet Explorer. It does _not_ work with Firefox ver 3.6.1 nor ver 8.0.1 (which I upgraded to, to see if that would solve the problem). The MDC FAQ solution is not a solution, because it forces the html coder to change his language just to accommodate Firefox. Firefox needs to change to conform to standards.
    What did work was that I followed the solution offered on:
    http://hutchinson.belmont.ma.us/tth/firefox3.html
    "How to reenable symbol font in Firefox 3 on Windows"
    <b>**********Solution*********</b>
    Download the file:
    http://hutchinson.belmont.ma.us/tth/symbol8859.otf
    Go to Control Panel/Fonts/Install New Font
    Install the font that was downloaded.
    <b>************Problem Solved*********</b>
    I think Firefox wants you to use _its_ font faces, not the standard Windows fonts. They do not have a Symbol font to replace the Windows TTF, I guess.

  • I open iWeb but the main window doesn't open/appear on screen. The little windows like the inspector and font windows appear. Can anyone help?

    I open iWeb but the main window doesn't open/appear on screen. The little windows like the inspector and font windows appear. Can anyone help?

    Try the following:
    1 - delete the iWeb preference file, com.apple.iWeb.plist, that resides in your
         User/Home/Library/ Preferences folder.
    2 - delete iWeb's cache file, Cache.db, that is located in your
    User/Home/Library/Caches/com.apple.iWeb folder (Snow Leopard and Earlier).
    3 - launch iWeb and try again.
    NOTE:  In Lion and Mountain Lion the Library folder is now invisible. To make it permanently visible enter the following in the Terminal application window: chflags nohidden ~/Library and hit the Enter button - 10.7: Un-hide the User Library folder.
    OT

  • HT2509 Hello I wonder if anyone knows how to find, download and install a suitable IPA (phonetics) font for the Mac Air? I need to be able to use a pop up window of fonts.

    Hello I wonder if anyone knows how to find, download and install a suitable IPA (phonetics) font for the MacBook  Air? I need to be able to use a pop up window of fonts.

    Unless you've done anything to change it, Google keeps every email that ever passes through their server in your All Mail folder/mailbox/label. Even if you delete stuff, they hold onto it, there. You have to go out of your way to actually delete anything permanently.

  • Java program for installing font on windows

    Hi,
    I want to write a java program that installs required fonts on windows machine. On my machine windows is installed on "C:\WINDOWS" directory.
    So, naturally "c:\WINDOWS\Fonts" directory I want to paste my font files.
    I am writing file handling code for the same. But, how to know dynamically the location of windows installation directory?
    I tried using System.getProperty("windir"), but it is not working?
    Can somebody help me?
    regards,
    Anand

    1) Use VB
    2) Who said that such a property exists?
    3) In Java 1.5, use System.getEnv()

  • Persian font in MAC and WINDOWS.

    Hi
    I am using persian font (X-series) on my mac and I haven't any problem with these fonts.
    *:X series font are for pupular persian font like the B series.
    When i want to save my power point with a type that windows can read/write it the X-series persian font are missing and all of my ducument has a bad clutter!!
    I know that i can save my document as .PDF files but when I should do some changes on wndows office I need have good and famous persian fonts that are common between win and mac.
    thanks for your helps..........

    If you want to open the Powerpoint file in Windows, you should also install those fonts at Windows machine too.
    They won't show as nice as the Mac due to lack of text anti-aliasing on Windows, but they will work on Windows too.

  • My entire screen is in tiny font, toolbars, tabs and  the main window

    I found my answer on how fix the size of my resolution back to normal on here but having trouble with getting my settings and font size back to default. Everything on my screen is smaller and not sure how to go back to "normal". Any help would be appreciated.
    I have a mac book white 2009..i think it was a gift. mac os x 10.5.8 hope that helps.

    If it's Snow Leopard, there is no true full screen for windows, but you can resize the windowby moving it to top left by dragging on the top "frame" then drag the bottom right corner to fill as much screen as you want. Once you've set the size that file or application should remember it and open at that size every time.
    But you need to do that for each appication.
    For Lion, ask in the Lion forum; I understand it has proper full-screen capability, but I don't use Lion so can't advise.

Maybe you are looking for

  • Copied photos to wrong place

    My Lightroom  image files (photos)  are on an external drive that I back up frequently. Somehow, during the import process I copied several day's photos to my "My Pictures" folder on my main drive by mistake. Is there a way to move those files to the

  • Portgroups related to Logical Switches

    Can anyone decode the naming convention of portgroups created by the logical switches like i can understand transit network is the name of logical switch and 5000 is the VXLAN id but what are the other words given here i just want to understand. Scre

  • Save As in Title

    We talked about this before, using "New Title Based on Current Title" to rename a Title. I'm not able to take a Title and save it under a different name in the same directory. When I save a title using "New Title Based on Current Title' I don't even

  • Why wont iwork work??

    I keep getting this message when I try to open up my iWork. It worked just fine and all of a sudden this..... "Pages cannot be opened because of a problem." Check with developer to make sure pages works with this versionof Mac OSX Process:         Pa

  • How to edit content in sample.portal

    Hi everybody, I am a newbie at Weblogic Workshop 8.1. I am trying to edit the content (in Portal Administration) of the sample.portal. I use the weblogic user (which I suppose has all the rights and privileges needed). I cannot see any content to be