User Tag List

Results 1 to 4 of 4

Thread: [request] Font's name reader

  1. #1
    Clicker Fusion 2.5Fusion 2.5 MaciOS Export ModuleInstall Creator Pro
    Fusion 2.5 (Steam)Fusion 2.5 Developer (Steam)Android Export Module (Steam)HTML5 Export Module (Steam)Universal Windows Platform Export Module (Steam)

    Join Date
    Apr 2008
    Location
    Indonesia
    Posts
    694
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    [request] Font's name reader

    I wondering if there is an extension that can reads the font name. Is there any?

  2. #2
    Clicker Multimedia Fusion 2 DeveloperiOS Export ModuleSWF Export Module
    Jaffob's Avatar
    Join Date
    May 2008
    Location
    USA
    Posts
    1,833
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [request] Font's name reader

    I don't understand. Read the font name of what?

  3. #3
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [request] Font's name reader

    Psuedocode time!!

    Load any .ttf file in a Binary Extension (Binary Object, or maybe Binary Array object) and then follow these instructions:

    Code:
    //Find out how many tables there are in the file.
      Set Pointer to '4' 
      "Number of tables" = Get Unsigned Short
    
    //Move to the list of contents
      Set Pointer to '12'
    
    //Scan each line in the list of contents
    //trying to find the 'Names Table'
    LOOP 'Number of tables' times
     {
       "Table ID" = Get ASCII String, 4 bytes long
    
       Advance Pointer by '8'
       "Table Location" = Get Unsigned Long
    
       Advance Pointer by '4'
       "Table Length" = Get Unsigned Long
    
       Advance Pointer by '4'
    
       IF ("Table ID" == "name")
       { Then: Stop loop } //Once the Name Table has been found, stop the search loop.
     }
    
    
    //Read the Name Table
      Set Pointer to 'Table Location'
      Advance Pointer by '2'
      "Number of Strings" = Get Unsigned Short
      Advance Pointer by '2'
      "Offset to String Def" = Get Unisgned Short
      Advance Pointer by '4'
    
    LOOP 'Number of Strings' times
     {
       Advance Pointer by '6'
       "String Type" = Get Unsigned Short
       Advance Pointer by '2'
       "String Length" = Get Unsigned Short
       Advance Pointer by '2'
       "String Offset" = Get Unsigned Short
    
       IF ("String Type" == '1')
       { Then: Stop loop } //Once the name string is found, stop the search loop.
     }
    
    //Read the name
      Set Pointer to 'Offset to String Def'
      Advance Pointer by 'String Offset'
      "Font Name" = Get ASCII String, 'String Length' bytes long
    
    RETURN "Font Name"

    And that's it. It's doable in MMF2 with a binary extension, or you may be able to get some kind person to convert this into C code and build an extension out of it.

  4. #4
    Clicker Multimedia Fusion 2

    Join Date
    Sep 2006
    Location
    Britain, South Coast
    Posts
    1,030
    Mentioned
    0 Post(s)
    Tagged
    0 Thread(s)

    Re: [request] Font's name reader

    http://www.clickteam.com/epicenter/ubbthreads.php?ubb=showflat&Number=106181#Post1061 81

    Never say I don't do anything for you

Similar Threads

  1. [Request] Self Reader
    By Game_Master in forum Extension Development
    Replies: 3
    Last Post: 19th August 2011, 01:44 AM
  2. [Request] RSS reader
    By CnCs in forum Extension Development
    Replies: 8
    Last Post: 19th April 2011, 10:38 PM
  3. Font Name Reader
    By Dines in forum File Archive
    Replies: 6
    Last Post: 31st August 2008, 02:20 AM
  4. [Request] Acrobat Reader extension
    By RichardC in forum Extension Development
    Replies: 15
    Last Post: 7th June 2007, 06:42 PM
  5. [Request/Idea] Font Installer Object
    By Dines in forum Extension Development
    Replies: 15
    Last Post: 23rd January 2007, 02:29 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •