Page 1 of 2 12 LastLast
Results 1 to 25 of 26

Thread: Is there a way to custom GetTextAtEx to work differnt writing?

  1. #1
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default Is there a way to custom GetTextAtEx to work differnt writing?

    Hi i was wondering if you can modify gettextatex to work with differnt kinds of writings such as arial or times new roman, or other custom grapich letters, switch out the images in font will that work, or can you create another folder in font witch woud be just like a new writings? could it practially be designed to work with any writings? if you can customise it, is it hard? or you just need to take 26 photos and copy it into a new folder in fonts and then just do
    Result := IsTextAtEx(184, 34, 'textdisplayed', 30, you'recustomsymbols, True, False, 0, 0,
    -1);

    Is it that easy? if not then how you make it ?


    a update that woud make it work with all known computer writings woud be really nice like andy, courier, georgia, ms sans sheif, times new roman and rest

  2. #2
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    -Bump-

  3. #3
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  4. #4
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    For default fonts, you can just load System fonts. Have a look at Simba/Tests/systemfont (or something like this)



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  5. #5
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    This for scar:

    function LoadCharsFromFont2(fontname: string; fontsize: Integer; fontbold, fontitalic, fontunderline, fontstrike: Boolean): Integer;
    Load characters from Windows font in memory.
    Example:
    c := LoadCharsFromFont2('Courier New', 10, False, False, False, False);

  6. #6
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    When making bmps of the letters, does it need to be 100% accurate in order to work or can it be 1-3pixels in between each of them?

    Incase it is, i got a method to get it accurate, open the letters in paint.NET, hold ctrl+ until fit the screen, turn on pixel grid, choose square from tools, mark the letter, ctrl+c then open a new document with ctrl+n then do ctrl+v, voila accurate letter.
    Last edited by tom99; 07-19-2010 at 06:44 PM.

  7. #7
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  8. #8
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Ive made 26 lowercase letters bmps now for testing, so what do i do next to make it asign each letter with scar ?

  9. #9
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  10. #10
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    pascal Code:
    program new;
    var
      Font : TFont;
    begin
      Font := TFont.Create;
      Font.Name := 'Courier New';
      Font.Size := 10;
      Font.Style := [];
      LoadSystemFont(Font,'test');
      DisplayDebugImgWindow(0,0);
      DisplayDebugImgWindow(150,50);
      DrawBitmapDebugImg(BitmapFromText('BMP[0] has not been freed','test'));
      Font.free;
    end.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  11. #11
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Do they need to be named from 65.bmp - 122.bmp or can i change that so its a-z ?

    I tryed that script wizzup and its great but i woud also like to know how i can make my own fontset.

  12. #12
    Join Date
    Feb 2006
    Location
    Amsterdam
    Posts
    13,692
    Mentioned
    146 Post(s)
    Quoted
    130 Post(s)

    Default

    Quote Originally Posted by tom99 View Post
    Do they need to be named from 65.bmp - 122.bmp or can i change that so its a-z ?

    I tryed that script wizzup and its great but i woud also like to know how i can make my own fontset.
    Use LoadFont.



    The best way to contact me is by email, which you can find on my website: http://wizzup.org
    I also get email notifications of private messages, though.

    Simba (on Twitter | Group on Villavu | Website | Stable/Unstable releases
    Documentation | Source | Simba Bug Tracker on Github and Villavu )


    My (Blog | Website)

  13. #13
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    What am i doing wrong here ?
    get type mismatch

    var
    myfont: extended;
    begin
    myfont:= LoadChars2('Fonts\myfont');
    if(GetTextAtEx(16, 505,620, 573, 255, 'text', false, false, 0, 5, 0, 0)) then
    writeln('Found text');
    end.

  14. #14
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  15. #15
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Also with integer i get same error message.

  16. #16
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

    Default

    oh you mean at the line with GetTextAtEx?

    its because your using it as a Boolean when it returns a string

    do this
    SCAR Code:
    program New;
    var
      myfont: Integer;
      TheText: string;
    begin
      MyFont:= LoadChars2('Fonts\myfont');
      TheText:= GetTextAtEx({x}, {y}, {tol}, MyFont, False, False, 0, 3, {TextColor}, {TextLength}, True, tr_AllChars)
      Writeln(TheText);
    end.

    just fill in the green bits

    ~shut
    Last edited by Shuttleu; 07-20-2010 at 02:17 PM.

  17. #17
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    That search for TheText ? and on textlength is there a option for unlimited or does it need to be same as the actual text its searching for? is it a option to make it ignore color?

  18. #18
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    That searches for MyFont. It needs to be the same as the actual text, I think. If you don't know the length, have a for loop for that. (for i := 1 to 1000 do GetTextAtEx(x, y, Tol, MyFont, False, False, 0, 3, Col, i, True, tr_AllChars);.) No. You need to get the right color, I think.

  19. #19
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    It execute but does nothing, also does it search at a point or area? if it only search on a point where shoud that be? just infront of first letter?

    But like this it wont compile,

    program textlocator;
    var
    myfont,text,i: Integer;
    // TheText: string;
    begin
    MyFont:= LoadChars2('Fonts\myfont');
    for i := 1 to 1000 do GetTextAtEx(61, 555, 200, text, False, False, 0, 3, 0, i, True, tr_AllChars)
    Writeln(TheText);
    end.

    nvm forgot semicolon behind syntax doh (it executes)


    It wont find any text
    Last edited by tom99; 07-20-2010 at 03:22 PM.

  20. #20
    Join Date
    Aug 2007
    Location
    in a random little world
    Posts
    5,778
    Mentioned
    0 Post(s)
    Quoted
    7 Post(s)

  21. #21
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    I got the cords there but it dont find the text :S

    I saved and then when i run it again i get this, LoadChars failed - folder "Fonts\MyFont" does not exist
    Alltough it does exist.

    k seems like scar dont know where its located on the comp, but even apppath+'Fonts\MyFont dont work, it loads but dont find any text
    Last edited by tom99; 07-20-2010 at 03:59 PM.

  22. #22
    Join Date
    Nov 2006
    Posts
    2,369
    Mentioned
    4 Post(s)
    Quoted
    78 Post(s)

    Default

    I think you have to do like LoadChars2(AppPath + 'Fonts\MyFont\');

  23. #23
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    Quote Originally Posted by antti mies View Post
    I think you have to do like LoadChars2(AppPath + 'Fonts\MyFont\');
    I did but, i see all the other fonts got a .svn folder with .svn-base files, is this something you need when you create a new?

  24. #24
    Join Date
    Jan 2010
    Posts
    5,227
    Mentioned
    6 Post(s)
    Quoted
    60 Post(s)

    Default

    No.

  25. #25
    Join Date
    Nov 2009
    Posts
    471
    Mentioned
    0 Post(s)
    Quoted
    4 Post(s)

    Default

    What is it for then? and have a.bmp-z.bmp on each letter shoud work ?

Page 1 of 2 12 LastLast

Thread Information

Users Browsing this Thread

There are currently 1 users browsing this thread. (0 members and 1 guests)

Posting Permissions

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