[Okta Webinar] Learn how to a build a cloud-first strategyRegister Now

x
?
Solved

OpenType font

Posted on 2006-05-25
8
Medium Priority
?
927 Views
Last Modified: 2013-12-03
Another question is: How to find out, if font is OpenType?
0
Comment
Question by:JackKuti
  • 4
  • 4
8 Comments
 
LVL 34

Expert Comment

by:Slick812
ID: 16777925
Ok, since you are not getting any other response here, what do you mean? Can you say what you mean by "font" in your question -->
   "  if font is "
0
 

Author Comment

by:JackKuti
ID: 16783288
I mean the type of font - eg. Arial = Open Type font; Book Antiqua= Open Type font ...
0
 
LVL 34

Expert Comment

by:Slick812
ID: 16785456
you did not understant what I was asking, I got what you just explained, what I mean  - - - ->  Is it a "System" font, a program installed font, or a font file?
But I guess from your statement, you want to get the properties of an installed system font and detect if it is and Open Type, , I guess you know that Open Type is only recognized in win  XP  and newer systems?

I beleive that the -
EnumFonts callback routine
in win  XP  and newer, has these added values in the  nFontType

OPENTYPE_FONTTYPE = $10000;


function EnumFontsProc(var LogFont: TLogFont; var TextMetric: TTextMetric;
  FontType: Integer; Data: Pointer): Integer; stdcall;

begin
Result := One;

if ((FontType and OPENTYPE_FONTTYPE) <> Zero)   then
   DoOpenType;



0
Concerto's Cloud Advisory Services

Want to avoid the missteps to gaining all the benefits of the cloud? Learn more about the different assessment options from our Cloud Advisory team.

 

Author Comment

by:JackKuti
ID: 16785606
But there is no  OPENTYPE_FONTTYPE expression in the API EnumFontsProc function, only Raster_Fonttype, Device_Fonttype and Truetype_Fonttype. Even in the book on API font and text functions I have fount only these three possibilities.  So neither Delphi does recognize this  OPENTYPE_FONTTYPE expression. ( I have Win XP)
0
 
LVL 34

Accepted Solution

by:
Slick812 earned 500 total points
ID: 16790396
const
NTM_TT_OPENTYPE    = $40000;


function ListFonts(const LogFontEx: TEnumLogFontEx; const NTM: TNewTextMetric;
  FontType: Integer; pStore: PChar): Integer; stdcall;
begin
Result := 1;
if NTM.ntmFlags and NTM_TT_OPENTYPE <> 0 then
  begin
  if lStrCmpI(@LogFontEx.elfLogFont.lfFaceName, pStore) <> 0 then
    begin
    StrCopy(pStore, @LogFontEx.elfLogFont.lfFaceName);
    MainForm.ListBox1.Items.Add(LogFontEx.elfLogFont.lfFaceName);
    end;
  end;
end;

procedure TMainForm.sbut_EnumFontsClick(Sender: TObject);
var
LogFont: TLogFont;
sDC: HDC;
begin
if not ((Win32Platform = VER_PLATFORM_WIN32_NT) and
       (Win32MajorVersion >= 5) and (Win32MinorVersion >=1))then
  begin
  ShowMessage('ERROR - OpenType Search requires win XP or newer');
  Exit;
  end;
ZeroMemory(@LogFont, sizeof(LogFont));
LogFont.lfCharset := DEFAULT_CHARSET;
//LogFont.lfFaceName := 'Arial'#0;
sDC := GetDC(0);
EnumFontFamiliesEx(sDC, LogFont, @ListFonts, Integer(@LogFont.lfFaceName), 0);
ReleaseDC(0, sDC);
end;


 = == = = = = = = = = = = = = = = = = = = = = = = =
If you are doing much with API fonts you should go to MSDN and access the About Fonts at -
http://msdn.microsoft.com/library/default.asp?url=/library/en-us/gdi/fontext_371v.asp
and read every thing they have there about fonts, font functions and font info acess
0
 

Author Comment

by:JackKuti
ID: 16797459
What does value  $40000 mean or where it can be found?
0
 
LVL 34

Expert Comment

by:Slick812
ID: 16801447
??
I am not sure what you are asking? ? Or what you may mean (a reference to vocabulary) ?
it is found in my code above, , I can not say about what it means ? since I have no reference to it meaning anything, it's just a windows system number (acually a single "Bit" value) used as a value to indicate an OpenType - TrueType font (if that bit is set in the ntmFlag the font should be an OpenType TrueType), , , Maybe you mean where I got the value from, , It''s in a Microsoft C code Header file ( I think maybe WinGdi.h ) released by MS for the Visual studio or other MS programming languages. . . I got that one from code in a delphi pascal translation of the C code header file, I do not remember who translated that one, but the guys at the JEDI project usually try to produce pascal translations of the newer C code header files, however, if you come across a "New" constant identifier in the MSDN help and can not find it's value, you can go to the windows or C++ here at EE and ask for the value.
0
 

Author Comment

by:JackKuti
ID: 16801834
Yes, I was interested in the source of the value $4000. Thanks a lot.
0

Featured Post

What does it mean to be "Always On"?

Is your cloud always on? With an Always On cloud you won't have to worry about downtime for maintenance or software application code updates, ensuring that your bottom line isn't affected.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

In this tutorial I will show you how to use the Windows Speech API in Delphi. I will only cover basic functions such as text to speech and controlling the speed of the speech. SAPI Installation First you need to install the SAPI type library, th…
Ever visit a website where you spotted a really cool looking Font, yet couldn't figure out which font family it belonged to, or how to get a copy of it for your own use? This article explains the process of doing exactly that, as well as showing how…
Excel styles will make formatting consistent and let you apply and change formatting faster. In this tutorial, you'll learn how to use Excel's built-in styles, how to modify styles, and how to create your own. You'll also learn how to use your custo…
If you’ve ever visited a web page and noticed a cool font that you really liked the look of, but couldn’t figure out which font it was so that you could use it for your own work, then this video is for you! In this Micro Tutorial, you'll learn yo…
Suggested Courses

872 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question