Page 1 of 2 12 LastLast
Results 1 to 10 of 20

Thread: d3d font and italics (clootie help?)

  1. #1

    d3d font and italics (clootie help?)

    Hi this is not strictly Omega related as I have a problem with the unit D3DFont by Clootie.

    When I create a font and set the font creation flag D3DFONT_ITALIC then the text looks terrible.

    See image

    Each letter wipes over the previous one. Is there a way that I can prevent this from happening?

    If so how?
    The views expressed on this programme are bloody good ones. - Fred Dagg

  2. #2

    d3d font and italics (clootie help?)

    Looks like the letters are cut off on the right.

    They get thicker because italic perhaps?

    Can you give them more space somehow?

    Firle

  3. #3

    d3d font and italics (clootie help?)

    Hi Firle,

    I have just had a brain wave the textures need to be wider for italic fonts, the standard square is not enough.

    Bugger. Fonts are almost impossible to do easily. The old delphiX days of textout certainly seem a breeze now.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  4. #4

    d3d font and italics (clootie help?)

    Use ID3DXFont - it has all suport for GDI functionality (including kerning stuff, etc.) and currently speedy enougth (especially if supplied with sprite surface for caching).
    There are only 10 types of people in this world; those who understand binary and those who don't.

  5. #5

    d3d font and italics (clootie help?)

    Hi Clootie,

    Is ID3DXFont only for DirectX 9 onwards? In other words I cannot use it for Omega as it uses dx 8.1. Is that correct?

    I am not sure if my project can be updated to use the dx 9 version of Omega. I will have to have a go.

    Firle do you know if ID3DXFont is available in Omega dx 9 version?
    The views expressed on this programme are bloody good ones. - Fred Dagg

  6. #6

    d3d font and italics (clootie help?)

    Yes, (at least usable) ID3DXFont is DX9 interface (actually it should be from 2004 SDK or later IIRC).

    ID3DXFont is used through D3DX9.pas unit and does not require any additional help from Omega lib. But using ID3DXFont will tie your application to one of the MS d3dx9_xx.dll's
    There are only 10 types of people in this world; those who understand binary and those who don't.

  7. #7

    d3d font and italics (clootie help?)

    Ok thanks for that Clootie.

    I will see about possibility of upgrading the project to dx 9. That would simplify it.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  8. #8

    d3d font and italics (clootie help?)

    Hi Czar,

    you can get the DX9 version from my side, if you don't have it.
    I also have my own new version which is upgraded to 9.0c with Clooties Dezember Update (latest headers). If you want it, let me know, I just made minor changes to OmegaSprite (Z value changing everytime possible) and OmegaGUI '(fixed Problem with Omegaedit), added Sly's Fastloading to OmegaImagelist, but I think you don't use this stuff...nice weekend

    Firle

  9. #9

    d3d font and italics (clootie help?)

    HI Firle,

    Thanks, I had a play around with dx9 version today and decided too many problems with upgrading 40 odd programs.

    The fonts are only a problem on two programs that use lots of text, I will try to fix it a different way. One method would be to use a pre-rendered font and basically make a proper bitmap font engine. The standard one that comes with Omega is not up to scratch for what I want.

    No matter, I will figure something out.
    The views expressed on this programme are bloody good ones. - Fred Dagg

  10. #10

    d3d font and italics (clootie help?)

    Quote Originally Posted by czar
    One method would be to use a pre-rendered font and basically make a proper bitmap font engine.
    You could use FontTool from Asphyre with Omega. It can export font to PNG image, creating .INC file with letter information. It would be a simple matter of displaying the proper letter and adding displacements from the table. Something like that:

    Code:
    // include INC file written by FontTool
    {$include myfont.inc}
    
    var
     i, Index, MyX: Integer;
    begin
     MyX:= x; // (x, y) is where your text should be
     for i:= 1 to Length(Text) do
      begin
       Index:= Byte(Text[i]) - Byte(FirstChar);
       // draw INDEX pattern at (MyX, y)
       Inc(MyX, LetterSizes[Index].x);
      end;
    end;

Page 1 of 2 12 LastLast

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
  •