Autor Beitrag
LonghornUser
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: So 05.03.06 20:11 
Hallo,
ich möchte via delphi-programm eine Schriftart installieren, unabhängig davon, ob sie schon installuert ist oder nicht, es soll in beiden Fällen gehen.
Die Font in das Fonts-Verzeichnis von Windows zu kopieren geht schon ohne Probleme. Aber ich glaube, die Schriftart muss noch installiert werden (oder registriert?). Weil nur kopieren reicht nicht aus, damit auch andere Anwendungen diese nutzen können, oder ?

Danke schonmal für alle Hinweise.

Ciao LHUser
Marc.
ontopic starontopic starontopic starontopic starontopic starontopic starhalf ontopic starofftopic star
Beiträge: 1876
Erhaltene Danke: 129

Win 8.1, Xubuntu 15.10

BeitragVerfasst: So 05.03.06 20:29 
hallo,

meines wissen nach reicht es den font einfach in den 'c:\windows\fonts'-ordner zu kopieren.
registrieren bauchst du dabei nichts ;)
d.h ich musste bisher noch keinen font registrieren/installieren und kann ihn dennoch in jeder anwendung benutzen :)
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: So 05.03.06 22:07 
Ja, wenn ich die Schriftart "von Hand" in das Verzeichnis kopiere, geht das. Aber wenn ich sie per Delphi Programm mit CopyFile() reinkopiere, gehts noch nicht.
Sie muss noch registriert werden, glaube ich aber wie ?
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 05.03.06 22:08 
Das müsste eigentlich auch so funktionieren. Registrieren kannst du da nix.

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: So 05.03.06 22:45 
user profile iconGTA-Place hat folgendes geschrieben:
Das müsste eigentlich auch so funktionieren. Registrieren kannst du da nix.

Hehe, das stimmt so aber nicht ;>
ausblenden Delphi-Quelltext
1:
2:
AddFontResource('Schriftdatei.ttf');
SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0);

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
GTA-Place
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
EE-Regisseur
Beiträge: 5248
Erhaltene Danke: 2

WIN XP, IE 7, FF 2.0
Delphi 7, Lazarus
BeitragVerfasst: So 05.03.06 22:48 
Gut, wieder was neues gelernt ;-)

_________________
"Wer Ego-Shooter Killerspiele nennt, muss konsequenterweise jeden Horrorstreifen als Killerfilm bezeichnen." (Zeit.de)
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: So 05.03.06 22:57 
user profile iconJayEff hat folgendes geschrieben:
user profile iconGTA-Place hat folgendes geschrieben:
Das müsste eigentlich auch so funktionieren. Registrieren kannst du da nix.

Hehe, das stimmt so aber nicht ;>
ausblenden Delphi-Quelltext
1:
2:
AddFontResource('Schriftdatei.ttf');
SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0);


Naja, das nützt aber, glaube ich nicht viel.
Ich möchte folgendes machen:
Ich schreibe einen Installer, der Schriftarten für das installierte Programm installieren soll. Ich glaube, dazu ist dein Code nicht nutzbar, oder ? Das wäre bestimmt nur für die eigene Anwendung oder ?
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: So 05.03.06 22:59 
Schon ausprobiert? wenn ja, dann hättest du bemerkt, dass die Datei in den Fonts-Ordner kopiert wurde und in allen anderen Programmen nutzbar ist :/
SendMessage sendet ja auch eine WM an ein globales Handle wenn ich mich nicht irre. HWND_BROADCAST ist doch mal sicher ne Konstante? ^^ Das Sendmessage sagt windows: Hey! Da is ne neue Schrift installiert worden!

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: So 05.03.06 23:13 
Cool, hast Recht. Geht wunderbar. War wohl zu voreilig :)
Und wie bekomm ich die Schriftart dann wieder weg ? Reicht löschen und der SENDMESSAGE-Befehl oder muss die Ressource auch weg ?
JayEff
ontopic starontopic starontopic starontopic starontopic starontopic starontopic starofftopic star
Beiträge: 2971

Windows Vista Ultimate
D7 Enterprise
BeitragVerfasst: So 05.03.06 23:16 
Mooment. ich hab das mal realisiert..... *such*
ausblenden Delphi-Quelltext
1:
2:
RemoveFontResource('Matrix Code Font.ttf');
SendMessage(HWND_BROADCAST,WM_FONTCHANGE,0,0);
ganz einfach ^^
Das hab ich bei meinem Suche in: Delphi-Forum, Delphi-Library MATRIX SCREENSAVER benutzt...

_________________
>+++[>+++[>++++++++<-]<-]<++++[>++++[>>>+++++++<<<-]<-]<<++
[>++[>++[>>++++<<-]<-]<-]>>>>>++++++++++++++++++.+++++++.>++.-.<<.>>--.<+++++..<+.
LonghornUser Threadstarter
ontopic starontopic starontopic starontopic starontopic starontopic starofftopic starofftopic star
Beiträge: 796



BeitragVerfasst: Mo 06.03.06 15:35 
Super, danke !