Zum Inhalt springen
View in the app

A better way to browse. Learn more.

Fachinformatiker.de

A full-screen app on your home screen with push notifications, badges and more.

To install this app on iOS and iPadOS
  1. Tap the Share icon in Safari
  2. Scroll the menu and tap Add to Home Screen.
  3. Tap Add in the top-right corner.
To install this app on Android
  1. Tap the 3-dot menu (⋮) in the top-right corner of the browser.
  2. Tap Add to Home screen or Install app.
  3. Confirm by tapping Install.

Fonts einlesen und ausgeben?????

Empfohlene Antworten

Veröffentlicht

Hi!

Ich hab mal wieder ne Frage:

Wie kann in in Visual C++ meine Fonts (Schriftarten) die auf meim System gespeichert sind einlesen und in einer Dialogbasierten Anwendung in Form einer Liste wieder ausgeben????

Wär net schlecht, wenn mir jemand weiter helfen könnte!

DANKE!:);)

Also damit kannst Du direkte Pixelfonts von den Systemfonts auslesen und direkt verwenden:

Einfach ein CFont Objekt erzeugen und dann CreatePointFont entsprechend dafür aufrufen. Wie das mit der Enumeration genau funktioniert hab ich noch nicht probiert, aber damit kannst Du dann alle zur Verfügung stehenden Fonts namentlich bekommen.

CFont::CreatePointFont

BOOL CreatePointFont( int nPointSize, LPCTSTR lpszFaceName, CDC* pDC = NULL );

Return Value

Nonzero if successful, otherwise 0.

Parameters

nPointSize

Requested font height in tenths of a point. (For instance, pass 120 to request a 12-point font.)

lpszFaceName

A CString or pointer to a null-terminated string that specifies the typeface name of the font. The length of this string must not exceed 30 characters. The Windows EnumFontFamilies function can be used to enumerate all currently available fonts. If lpszFaceName is NULL, the GDI uses a device-independent typeface.

pDC

Pointer to the CDC object to be used to convert the height in nPointSize to logical units. If NULL, a screen device context is used for the conversion.

und hier noch für die Enumeration:

EnumFontFamilies

The EnumFontFamilies function enumerates the fonts in a specified font family that are available on a specified device.

EnumFontFamilies and EnumFontFamProc are maintained for compatibility with 16-bit versions of Windows. Win32-based applications should call the EnumFontFamiliesEx function.

int EnumFontFamilies(

HDC hdc, // handle to device control

LPCTSTR lpszFamily, // pointer to family-name string

FONTENUMPROC lpEnumFontFamProc,

// pointer to callback function

LPARAM lParam // pointer to application-supplied data

);

Parameters

hdc

Handle to the device context.

lpszFamily

Pointer to a null-terminated string that specifies the family name of the desired fonts. If lpszFamily is NULL, EnumFontFamilies randomly selects and enumerates one font of each available type family.

lpEnumFontFamProc

Specifies the procedure-instance address of the application-defined callback function. For information about the callback function, see EnumFontFamProc.

lParam

Pointer to application-supplied data. The data is passed to the callback function along with the font information.

Kommt darauf an was du machen willst. CFontDialog hilft in dialogfeldbasierten Anwendungen meist weiter.....

Will sie ja in einer Liste ausgeben....etwas anderes macht CFontDialog auch nicht.

Wenn er die Namen irgendwie speichern will etc. dann geht das aber über CFontdialog auch, nur etwas umständlich, aber mich würde interessieren wo man sowas denn braucht????

Z.B. wenn man den voreingestellten Zeichensatz auf der Zielmaschine nicht vorliegen hat. Ein Kumpel von mir macht gerade für eine Versicherung eine Oberfläche, welche aber bei einem mit W95 ausgestatteten Laptop lustigerweise WingDings benutzt, weil der verwendete Zeichensatz offensichtlich dort nicht installiert war. Da kann eine Zeichensatzauswahl fürs Programm schon hilfreich sein. Aber stimmt schon - mit CFontDialog spart man sich einiges an Arbeit.

HI!

Ich brauch das, um die Namen,der auf dem System vorhandenen Schriftarten mit Schriftarten, die in einer .txt Datei gespeichert sind zu vergleichen!

Da wir ein Programm vertreiben, das bestimmte Schriftarten benötigt, um Daten auszuspielen und sie in einem Katalog anzuzeigen!

Archiv

Dieses Thema wurde archiviert und kann nicht mehr beantwortet werden.

Configure browser push notifications

Chrome (Android)
  1. Tap the lock icon next to the address bar.
  2. Tap Permissions → Notifications.
  3. Adjust your preference.
Chrome (Desktop)
  1. Click the padlock icon in the address bar.
  2. Select Site settings.
  3. Find Notifications and adjust your preference.