Autor Beitrag
Diamond
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 64
Erhaltene Danke: 1

Windows 7 Prof, OS X 10.8
Delphi XE Architect, XCode 4.4
BeitragVerfasst: Di 05.08.08 08:50 
Hi :D

Ich habe ein Problem bei einer FindFirst-, FindNextprozedur.
Meine Anwendung soll bei Programmstart alle verfügbaren Schriftarten in eine Combobox laden.
Das klappt auch soweit. Das Problem ist halt, dass die Fonts unter eigenschaften einen anderen Namen haben. :shock:
Aus "Agency FB (TrueType)", wird "AGENCYR.TTF".
Jedoch benötige ich für meine Anwendung nicht "AGENCYR" sondern "Agency FB".
Den Rest kürze ich via StringReplace.

Aber wie komm ich an den gewünschen Namen "Agency FB"?

bisher verwende ich die Prozedur:

ausblenden Delphi-Quelltext
1:
2:
3:
4:
5:
6:
7:
8:
9:
10:
11:
12:
13:
var
  SR : TSearchRec;

  ....

    if FindFirst(GetWinDir + '\Fonts\*.ttf', faAnyFile - faDirectory, SR)= 0 then
    begin
      Repeat
        SR.Name := Stringreplace(SR.Name,'.TTF','', []);
        frmOptionen.FontComboBox1.Items.Add(SR.name);
      Until FindNext(SR) <>0;
    end;
    FindClose(SR);


Wäre für Hilfe sehr dankbar :)

Moderiert von user profile iconNarses: Titel geändert am 06.08.08 um 10:10.


Zuletzt bearbeitet von Diamond am Mi 06.08.08 07:49, insgesamt 1-mal bearbeitet
baka0815
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 489
Erhaltene Danke: 14

Win 10, Win 8, Debian GNU/Linux
Delphi 10.1 Berlin, Java, C#
BeitragVerfasst: Di 05.08.08 09:15 
Versuch's mal mit Suche bei Google DELPHI ENUMFONTFAMILIES.
Nico72
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starontopic star
Beiträge: 50

Win XP, Vista
Delphi 7, Delphi 2006
BeitragVerfasst: Di 05.08.08 09:16 
Oder Screen.Fonts
Narses
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic star
Administrator
Beiträge: 10185
Erhaltene Danke: 1261

W11x64
TP3 .. D7pro .. D10.2CE
BeitragVerfasst: Di 05.08.08 10:36 
Moin!

Bitte ändere den Titel des Topics, da er wenig über das eigentlich Thema verrät. Hier der entsprechende Absatz aus den Richtlinien:

1.2 Beiträge:
Bitte formuliere den Betreff Deiner Beiträge so, dass andere Mitglieder anhand dieser bereits das eigentliche Thema festmachen können. Beiträge wie etwa "Eine Anfängerfrage" oder "Weiß jemand, wie das geht?" lassen den Leser im Unklaren darüber, was das Thema der Diskussion ist.[...]


Einfach oben bei Deinem ersten Beitrag auf user defined image oder user defined image klicken und den Titel ändern. Danke Dir!

cu
Narses

_________________
There are 10 types of people - those who understand binary and those who don´t.
Diamond Threadstarter
ontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic starofftopic star
Beiträge: 64
Erhaltene Danke: 1

Windows 7 Prof, OS X 10.8
Delphi XE Architect, XCode 4.4
BeitragVerfasst: Mi 06.08.08 07:50 
user profile iconNico72 hat folgendes geschrieben:
Oder Screen.Fonts



Manchmal ist die Lösung halt einfach simpler.. :roll:

thx :)
Blackheart666
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2195

XP
D3Prof, D6Pers.
BeitragVerfasst: Mi 06.08.08 08:06 
user profile iconDiamond hat folgendes geschrieben:
user profile iconNico72 hat folgendes geschrieben:
Oder Screen.Fonts



Manchmal ist die Lösung halt einfach simpler.. :roll:

thx :)

Was Du sicher mit Hilfe der Suche oder einen Blick in die Demos von Delphi von selbst gefunden hättest. :wink:

_________________
Blackheart666
Der Irrsinn ist bei Einzelnen etwas Seltenes, - aber bei Gruppen, Parteien, Völkern, Zeiten die Regel. (Friedrich Nietzsche)