AGB  ·  Datenschutz  ·  Impressum  







Anmelden
Nützliche Links
Registrieren
Thema durchsuchen
Ansicht
Themen-Optionen

Get font name stored in stream

Ein Thema von WojTec · begonnen am 14. Sep 2014 · letzter Beitrag vom 14. Sep 2014
Antwort Antwort
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#1

Get font name stored in stream

  Alt 14. Sep 2014, 11:13
Delphi-Version: 5
Getting TTF name from file is not hard, but how about the ones stored in stream? How to do it
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#2

AW: Get font name stored in stream

  Alt 14. Sep 2014, 11:22
Getting TTF name from file is not hard, but how about the ones stored in stream? How to do it
Are you sure with Delphi 5 as you flagged this thread or Delphi XE6 as your profile state?

How do you read the name from the file?

Mostly the file is opend as a stream and then the information is read from the stream
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
nuclearping

Registriert seit: 7. Jun 2008
708 Beiträge
 
Delphi 10.2 Tokyo Professional
 
#3

AW: Get font name stored in stream

  Alt 14. Sep 2014, 11:23
Can you be more detailed what you mean or try to achieve?

Because getting some "file information" stored in a stream is basically the same like getting information from an external file. The only difference is that you need to "locate" and "extract" the file from the stream.

So did you create the stream yourself? Or is it some unknown data format? Because if you created the stream yourself you should know the properties (like position and size) of the files / data you store?

Or do you mean how to "read" from a TMemoryStream or TFileStream ? If yes, then look up TStream.Read .
  Mit Zitat antworten Zitat
Benutzerbild von Sir Rufo
Sir Rufo

Registriert seit: 5. Jan 2005
Ort: Stadthagen
9.454 Beiträge
 
Delphi 10 Seattle Enterprise
 
#4

AW: Get font name stored in stream

  Alt 14. Sep 2014, 11:28
Also have a look at MSDN-Library durchsuchenAddFontMemResourceEx

And on SO there is also an example
http://stackoverflow.com/questions/1...ly-load-a-font
Kaum macht man's richtig - schon funktioniert's
Zertifikat: Sir Rufo (Fingerprint: ‎ea 0a 4c 14 0d b6 3a a4 c1 c5 b9 dc 90 9d f0 e9 de 13 da 60)
  Mit Zitat antworten Zitat
WojTec

Registriert seit: 17. Mai 2007
480 Beiträge
 
Delphi XE6 Professional
 
#5

Re: AW: Get font name stored in stream

  Alt 14. Sep 2014, 14:00
Are you sure with Delphi 5 as you flagged this thread or Delphi XE6 as your profile state?
Website marked themself, I forgot change to higher version

How do you read the name from the file?

Mostly the file is opend as a stream and then the information is read from the stream
If it will be native Delphi code, then probably will no problem read stream, but I'm using GDI32.DLL@GetFontResourceInfoW:

function GetFontResourceInfoW(lpszFilename: PWideChar; var cbBuffer: DWORD; lpBuffer: PWideChar; dwQueryType: DWORD): DWORD; stdcall;

This is working for both TTF and FON. But they want to see file path, not data pointer.

Yap, I have routines to load not installed fonts at runtime, but now I want to get name from font stream (stored in some TStream descent). Or in this way can get loaded font name

Geändert von WojTec (14. Sep 2014 um 14:21 Uhr)
  Mit Zitat antworten Zitat
Antwort Antwort


Forumregeln

Es ist dir nicht erlaubt, neue Themen zu verfassen.
Es ist dir nicht erlaubt, auf Beiträge zu antworten.
Es ist dir nicht erlaubt, Anhänge hochzuladen.
Es ist dir nicht erlaubt, deine Beiträge zu bearbeiten.

BB-Code ist an.
Smileys sind an.
[IMG] Code ist an.
HTML-Code ist aus.
Trackbacks are an
Pingbacks are an
Refbacks are aus

Gehe zu:

Impressum · AGB · Datenschutz · Nach oben
Alle Zeitangaben in WEZ +1. Es ist jetzt 21:14 Uhr.
Powered by vBulletin® Copyright ©2000 - 2024, Jelsoft Enterprises Ltd.
LinkBacks Enabled by vBSEO © 2011, Crawlability, Inc.
Delphi-PRAXiS (c) 2002 - 2023 by Daniel R. Wolf, 2024 by Thomas Breitkreuz