Results 1 to 7 of 7

Thread: Available fonts in Java

  1. #1
    Join Date
    Jan 2010
    Posts
    311

    Available fonts in Java

    Hello,
    I know how to retrieve the list of all font-family (Times, Arial, etc ...) available for GTK. Certainly there is font selection dialog allowing you to choose a family, style etc. but I wonder if there is not a function or a method to recover for implementing them in a combobox in java for example. I personally do not want to hard-code it for task.

  2. #2
    Join Date
    Dec 2009
    Posts
    202

    Re: Available fonts in Java

    One of my old problems that I finally resolved. Again the best solution is to directly explore the code of components GTK. So I traveled gtkfontselection code to find a great feature pango: pango_context_list_families (). I had to find that because the saw or she is stashed in the API is not really very lucky to find one if want to solve a problem to do. Little bit of code for a list of make available on your machine and sort of addition.

  3. #3
    Join Date
    Nov 2009
    Posts
    335

    Re: Available fonts in Java

    Check out the following code
    Code:
    int lstfnt(pngfml *** fml)
    (
      int fntfml; 
      conxfl(get(), fml; and fntfml); qsort(* Families, fntfml, sizeof (* pngfml), cpfml);
      
      return fntfml;
    )
     
    int cpfml (const void * a, const void * b)
    (
      const char * agetname = (*(** pngfml)a);
      const char * bgetname = (*(pngfml **)b);
      
      return g_utf8_collate (a_name, b_name);
    )

  4. #4
    Join Date
    Dec 2009
    Posts
    296

    Re: Available fonts in Java

    I wonder if I knows the list of "do" in Java and which have. I want to write in a text component using a font of the same type as that of the console (i.e that all letters are the same place) to get a display "aligned". And if you can also quickly identify the command, to be like:
    Code:
    text.setText (new Font (...));

  5. #5
    Join Date
    Dec 2009
    Posts
    178

    Re: Available fonts in Java

    The name of the printer (function) that you are looking for: Monospaced
    The answer to your last question depends on the text component that you use but you probably want to do:
    Code:
    composant.setFont (Font.getFont ("Monospaced"));
    composant.setText ("example");

  6. #6
    Join Date
    Aug 2009
    Posts
    155

    Re: Available fonts in Java

    Having the name of these fonts in a very short time is already substantial, but after completing this program for a graphics rendering is even better. Thus, it is much easier to select the desired font.

  7. #7
    Join Date
    Dec 2009
    Posts
    296

    Re: Available fonts in Java

    Having the name of these fonts in a very short time is already substantial, but after completing this program for a graphics rendering is even better. Thus, it is much easier to select the desired font.

Similar Threads

  1. Replies: 4
    Last Post: 04-09-2013, 11:04 PM
  2. Fonts does not appear in Acrobat 7.0 Pro
    By Ramanujan in forum Windows Software
    Replies: 6
    Last Post: 15-10-2011, 10:51 PM
  3. Fonts for Mac
    By Y2kCyK in forum Customize Desktop
    Replies: 2
    Last Post: 10-02-2009, 08:05 PM
  4. How To Transfer Fonts from one PC to another PC
    By MilesAway in forum Windows XP Support
    Replies: 2
    Last Post: 30-08-2007, 10:58 AM

Tags for this Thread

Bookmarks

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  
Page generated in 1,711,663,007.16180 seconds with 17 queries