CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 6 of 6
  1. #1
    Join Date
    Jun 2012
    Location
    UAE
    Posts
    62

    How to Add Symbols Like Phi , Sqaure Roots , Alpha .. to WinAPI32 Application

    I try to build Win32API engineering Applications..
    the output text should Have so Many Latin Letters Like Alpha , Phi , Theta
    and many math Symbols Like Square roots.. But I do not know how can I use these symbols with Function DrawText() ,

    Can I get any Help..

    Kind Regards

  2. #2
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: How to Add Symbols Like Phi , Sqaure Roots , Alpha .. to WinAPI32 Application

    Latin? You mean Greek?

    As for the issue, DrawTex is a bad choice for a task like this. What you need is rich text control.
    Best regards,
    Igor

  3. #3
    Join Date
    Jun 2012
    Location
    UAE
    Posts
    62

    Re: How to Add Symbols Like Phi , Sqaure Roots , Alpha .. to WinAPI32 Application

    Many thanks Igor for your answer.

    May I request further details or any Hints to use Rich text control.

    My Kind Regards.

  4. #4
    2kaud's Avatar
    2kaud is offline Super Moderator Power Poster
    Join Date
    Dec 2012
    Location
    England
    Posts
    7,822

    Re: How to Add Symbols Like Phi , Sqaure Roots , Alpha .. to WinAPI32 Application

    All advice is offered in good faith only. All my code is tested (unless stated explicitly otherwise) with the latest version of Microsoft Visual Studio (using the supported features of the latest standard) and is offered as examples only - not as production quality. I cannot offer advice regarding any other c/c++ compiler/IDE or incompatibilities with VS. You are ultimately responsible for the effects of your programs and the integrity of the machines they run on. Anything I post, code snippets, advice, etc is licensed as Public Domain https://creativecommons.org/publicdomain/zero/1.0/ and can be used without reference or acknowledgement. Also note that I only provide advice and guidance via the forums - and not via private messages!

    C++23 Compiler: Microsoft VS2022 (17.6.5)

  5. #5
    Join Date
    Nov 2000
    Location
    Voronezh, Russia
    Posts
    6,620

    Re: How to Add Symbols Like Phi , Sqaure Roots , Alpha .. to WinAPI32 Application

    Yes, 2kaud, you're absolutely right. In case all the required characters fit into standard Unicode set, and all the glyphs are implemented in the same font in use, DrawText may be okay.
    Last edited by Igor Vartanov; January 26th, 2014 at 10:40 AM.
    Best regards,
    Igor

  6. #6
    Join Date
    Apr 2000
    Location
    Belgium (Europe)
    Posts
    4,626

    Re: How to Add Symbols Like Phi , Sqaure Roots , Alpha .. to WinAPI32 Application

    1) Compile your app as a unicode app, not as a ANSI app.
    An ansi app is limited to 256 printable characters and it likely won't contain all the special maths symbols.

    if you just need simple one-line one-character at a time maths formula, then DrawText() will do.

    Richtext may not really fix your problem.

    If you want to handle really complex formulas in a visually aestethic method... You need to have a look at an advanced library to handle such things. visualising math is a branch of graphics programming all on it's own, and it's (still) not even solved anywhere near reasonably on browsers,
    most libraries catering to this end up creating bitmaps.

    there are even online LATEX to bitmap converters that may do what you need (if you can live with the performance issues with doing this over the internet).

Posting Permissions

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





Click Here to Expand Forum to Full Width

Featured