CodeGuru Home VC++ / MFC / C++ .NET / C# Visual Basic VB Forums Developer.com
Results 1 to 7 of 7

Thread: Custom Font

  1. #1
    Join Date
    Jan 2002
    Location
    bangalore india
    Posts
    183

    Custom Font

    HI all,

    How can i create a custom font to be used from my application?
    Is there any utility available for doing this?

    Thanx i advance
    Ratheeshravi
    Known Is A Drop..
    Unknown Is An Ocean....

    Programming Contest...

  2. #2
    Join Date
    Sep 2001
    Location
    Germany
    Posts
    34
    Take a look to the CFont class and CWnd::SetFont(..)

  3. #3
    Hi Sir,
    the following code maybe useful to you.
    Code:
    CFont* CFOCompProperties::CreateFont(CDC* pDC)
    {
    	LOGFONT logFont;
    	ZeroMemory(&logFont, sizeof(logFont));  
    	
    	logFont.lfHeight = -24;
    		
    	logFont.lfWeight = 700;
    	logFont.lfItalic = FALSE;
    	logFont.lfUnderline = FALSE;
    	logFont.lfStrikeOut = TRUE;
    	_tcscpy(logFont.lfFaceName, _T("MS Sans Serif"));
    	logFont.lfCharSet = DEFAULT_CHARSET;
    	
    	CFont* pFont = new CFont();
    	pFont->CreateFontIndirect(&logFont);
    	
    	return pFont;
    }
    Andy
    --------------------------------------------------------
    http://www.********.net
    XD++ MFC Library provides Microsoft Foundation Class (MFC)/Visual C++ developers with a complete library of MFC extension classes which implement a drag and drop (e.g. Visio or CoreDraw) graphical interface.

  4. #4
    Join Date
    Jan 2003
    Posts
    15
    I think, the question is not something about using the font in the application. Please make the question clear.

    Do u want an utility to create a your own font like Arial,Times new Roman?

    If it is the question, I know some words related to that. You can try Fontographer, Microsoft volt, Typographer.... I don't know how much this may help you.

    Regards,
    Mahesh

  5. #5
    Join Date
    Jan 2002
    Location
    bangalore india
    Posts
    183

    Smile Hi

    Thank u all.

    i am sorry that my question was not very clear.

    Main problem is - i want to create a custom font but i dont know which tool to use. Even if it is bitmap font also ok.

    Next - how can i use this custom font created ,in my application? is it like using other fonts?

    Regards
    Ratheeshravi
    Known Is A Drop..
    Unknown Is An Ocean....

    Programming Contest...

  6. #6
    Join Date
    Jan 2003
    Posts
    15

    Question Still ur question is not clear !!!!

    You admit that your question was not clear. But the sad think is it is not clear even now. Whether i was correct? You wanted a tool that creates a font. (your own font like Arial, TimesNewRoman) right?

    Then, did u try any of those tools i told?

    Regards,
    Mahesh

  7. #7
    Join Date
    Jan 2002
    Location
    bangalore india
    Posts
    183
    You admit that your question was not clear. But the sad think is it is not clear even now. Whether i was correct? You wanted a tool that creates a font. (your own font like Arial, TimesNewRoman) right?
    hello Mahesh,
    Thank u 4 mentioning those tools. i will try them .
    If u tell me which portion of my question is hard to understand , i will explain it again.
    regards
    Ratheeshravi
    Known Is A Drop..
    Unknown Is An Ocean....

    Programming Contest...

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