Topic: Additional fonts  (Read 10404 times)

Additional fonts
« on: September 16, 2011, 02:16:15 PM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
The checkbox "Additional Fonts" in copy files script is a joke currently  :wink:.
enabled or disabled, all the fonts from boot wim are copied (~ 14MB), cleaning to do ?

the idea is to add some essential fonts from install.wim, associate with this checkbox.

I saw the changes made by Lancelot to the Gena script "Esential Fonts and Codepages" to make it compatible PE2/3  :thumbsup:.

I have already written a script "Additional Fonts" before seeing it, with this font by default :
Quote
arial.ttf,arialbd.ttf,arialbi.ttf,ariali.ttf,ariblk.ttf,ARLRDBD.TTF,comic.ttf,comicbd.ttf,cour.ttf,courbd.ttf,courbi.ttf,couri.ttf,estre.ttf,framd.ttf,FRAMDCN.TTF,framdit.ttf,
georgia.ttf,georgiab.ttf,georgiai.ttf,georgiaz.ttf,impact.ttf,Lsans.TTF,Lsansd.TTF,Lsansdi.TTF,Lsansi.TTF,l_10646.ttf,mvboli.ttf,pala.ttf,palab.ttf,palabi.ttf,palai.ttf,sylfaen.ttf,
times.ttf,timesbd.ttf,timesbi.ttf,timesi.ttf,trebuc.ttf,trebucbd.ttf,trebucbi.ttf,trebucit.ttf,tunga.ttf,tungab.ttf,verdana.ttf,verdanab.ttf,verdanai.ttf,verdanaz.ttf

This from top 20 of the Windows font survey results, I do not know if it is reliable.
http://www.codestyle.org/css/font-family/sampler-WindowsResults.shtml

* Benefit, directly integrated in 1-files.script with the checkBox Additional font, easier for end-user and a script in less for user (hidden script).

* Disadvantage, we do not know what are the additional fonts. Except added a button "information" and a message written in the new "Additional Fonts" script. No selection.

I do not know what is best !!!

* Projects_Fonts.7z (41.77 kB - downloaded 542 times.)

:cheers:
« Last Edit: September 16, 2011, 02:28:51 PM by ChrisR »

Re: Additional fonts
« Reply #1 on: September 16, 2011, 02:19:26 PM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
An additional script would add the specific fonts from a folder, if needed by end-user,
with a small au3 program to write the registry.

a small beginning, example, I am not an au3 specialist to write it, a volunteer.
Quote
#Include <WinAPI.au3>
Global Const $QFR_DESCRIPTION = 1
Global $sFont = @WindowsDir & '\Fonts\verdanab.ttf' ;  all font in path *.* with a loop
Global $tData = DllStructCreate('wchar[260]')
 
; If Not FileExists ($sFont) then ...
DllCall('gdi32.dll', 'int', 'AddFontResource', 'str', $sFont)
DllCall('gdi32.dll', 'int', 'GetFontResourceInfoW','wstr', $sFont, 'int*', DllStructGetSize($tData), 'ptr', DllStructGetPtr($tData), 'int', $QFR_DESCRIPTION)
DllCall('gdi32.dll', 'int', 'RemoveFontResource', 'str', $sFont)
 
ConsoleWrite(DllStructGetData($tData, 1) & @CR)
; FileCopy($sFont, %TargetDir%\windows\fonts\)
; RunWait(@ComSpec&" /c reg load HKLM\Tmp_Software %InstallSRC%\Windows\system32\config\software", "", @SW_HIDE)
; RegWrite("HKEY_LOCAL_MACHINE\Tmp_Software\Microsoft\Windows NT\CurrentVersion\Fonts", $tData, "REG_SZ", $sFontName)  -  (TrueType) ?
; RunWait(@ComSpec&" /c reg unload HKLM\Tmp_Software", "", @SW_HIDE)

:cheers:

Re: Additional fonts
« Reply #2 on: September 16, 2011, 07:32:09 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
I do not know what is best !!!

You know, when it comes to such decisions, I tend to split scripts (+when possible share) for modularity, easy maintance, and ... 
Besides, Whatever you decide is to me also ok on this case.  :thumbsup:


Fonts of "Esential Fonts and Codepages" is so far enough to Gena, I feel it is also enough to Win7PE SE too..... In the end it is a small list of fonts commonly used by most applications.
If an application using a weird font, than Require,Font is there, so far I have not seen such a case with "Esential Fonts and Codepages" yet....


ps: Wow6432Node just added to "Esential Fonts and Codepages" following your lines....

ps: btw, some other Component scripts of Gena also Compatible with pe2/3, ex: CMD Adds .... Well, for a while I will not have time to work on them personally, but if you have ideas to syncronise (get more compatible, additions etc.) I will follow....

Re: Additional fonts
« Reply #3 on: September 16, 2011, 07:33:54 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
An additional script would add the specific fonts from a folder, if needed by end-user,
with a small au3 program to write the registry.

Very Good idea  :thumbsup:

I feel loading hive out of au3, and using parameter for target reg and fonts
ex:
fontregadd.exe "blabla....\Target\Win7PE_SE\Windows\Fonts" HKLM\Tmp_Software
ex:
fontregadd.exe "blabla....\Target\Gena\i386\Fonts" HKLM\Tmp_Software


would fit All PE world easly with a single script ;) and would make it easy to add not only ms fonts but also 3rd part fonts  :great: :great:


BlueLife busy these days, Maybe Galapo can take a look at....

Re: Additional fonts
« Reply #4 on: September 18, 2011, 01:30:20 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Hi ChrisR,

there is problem to use above au3 for PE,
I just discovered, billy's ttf files contains localized names for font names (check with hexeditor) AND as a result for registry name.

using above au3, on hostosenu with turkish localized settings , for arialbd.ttf gives
Arial Kalın
instead of
Arial Bold

:>

now imagine I am building an enu PE, and use above au3 codes to write font registry,
Here it will write turkish registries instead of enu..... (and because of some font entries that already comes from boot.wim (and or install.wim ???)) than I will have 2 entries for same font (ex: arialbd.ttf)

HKEY_LOCAL_MACHINE\SOFTWARE\Microsoft\Windows NT\CurrentVersion\Fonts
Arial Bold (TrueType)=ARIALBD.TTF
Arial Kalın (TrueType)=ARIALBD.TTF

yes it will probably work, but also pretty ugly.......


for hostos, it is ok to use above au3, since result automatically follows hostos settings, but for PE:

1) we require which localize id used by ttf
1b) (localized values already exists at IniVariables, but which one !!)
2) than we require to read data from ttf, and than write to registry.
.........
OR
1) we require a way to get enu name of ttf ?!?!
(guessing: regardless source language, boot.wim-install.wim font entries contains enu registry lines => need to be checked)
.....


On Gena, fonts of "Esential Fonts and Codepages" already have registry entries created by Saydin77 Builder,
which is similar to (I guess) getting fonts from install.wim
which I believe both list gives essential fonts required by most applications (so far all applications I've experienced)
rest is only copying to target  required.....


Well a bit long, but short indeed.

To add other fonts:
for temporary solution, using regfont.exe at buildtime is for now seems to me only available (and easy) solution
(and I may guess regfontx64.exe required ....)
for long term, 1 2 3....

as I mentioned previous post, I have not seen a trouble with "Esential Fonts and Codepages" yet.


See you.  :cheers:

Re: Additional fonts
« Reply #5 on: September 24, 2011, 12:13:38 AM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Hi Lancelot,

I'm not very active on the forum Currently, busy with other things.

Thank you for the indications on the localized fonts names  :thumbsup:.
So unfortunately not possible to do it at build times  :mad:.

I make a script that registers fonts at startup with the help of
'Esential Fonts and Codepages.script' from Gena, add fonts from a folder in addition, the Fonts.script (Windows Control Panel Fonts and Windows Font Cache Service) of Ludovici and I continued my AU3 code to add and register fonts at startup.

* Additional_Fonts.7z (785.41 kB - downloaded 293 times.)

correct me if needed.

See you,
:cheers:
« Last Edit: September 24, 2011, 12:16:42 AM by ChrisR »

Re: Additional fonts
« Reply #6 on: September 27, 2011, 11:12:20 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Hi ChrisR,

Everything looks fine to me  :great:

Here what I did on Gena to syncronise with you:
+ Added + fonts on your list to "Esential Fonts and Codepages" (and renamed script file to Fonts Codepages Essential.script)
+ Added a new script "Other Fonts" (Fonts Other.script) for 3rd party fonts,  additional options (for now PE3 only) and addfonts.exe  :thumbsup:
+ updated FontView.script to get compatible with W7PE SE - PE3 (Gena\Components\Core\1 System\Accessories)

For a while I guess, fonts case closed  :lol:

Sorry for late response, I am verrrry busy these days too :turtle:

Re: Additional fonts
« Reply #7 on: June 06, 2012, 08:19:39 PM »

Mikka

  • Code Baker
  • Chef
  • ***
  • Location: Germany
  • Date Registered: May 2012
  • Posts: 256
Let me unearth this thread by asking 2 questions:

1. Using version 3 of the script Additional Fonts and Codepages, I was wondering what's the minimal set of fonts needed for our PE?

Which directly leads me to no. 2:
How may I easily get rid of a couple of fonts that mostly seem to be broken anyway:
  • DaunPenh
  • DokChampa
  • Estrangelo Edessa
  • Euphemia
  • Gautami
  • Iskoola Pota
  • Kalinga
  • Kartika
  • Khmer UI
  • Latha
  • Mangal
  • Marlett
  • Microsoft Himalaya
  • Microsoft Yi Baiti
  • Mongolian Baiti
  • MV Boli
  • Nyala
  • Plantagenet Cherokee
  • Raavi
  • Shruti
  • Sylfaen
  • Tunga
  • Vrinda

Any suggestions?

Re: Additional fonts
« Reply #8 on: June 07, 2012, 05:41:18 AM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
As far as I know,
these are common fonts of bootwim (+waik)
where ms decide to put a small set of fonts on its task of miniboot, with a set of reasons....., including above....
That is the reason they exist on Win7PE SE build....

Quote
I was wondering what's the minimal set of fonts needed for our PE?
On Gena minimal is 0   :tongue: probably (not tested) same on Win7PE SE too  :cool:
no font is more suitable for tasks of only cmd with no exotic keyboard/language  :wink:

@Chris @JFX
maybe an option (default false) on "1 - Copy Files" saying "Reduce Fonts" ...
maybe not....

edit:
maybe not since they are only 13.8 mb and with wimcompressed fonts would shrink heavly (7z -> 4.8 mb)
I do not think necessary, up to you..

 :cheers:
« Last Edit: June 07, 2012, 06:05:03 AM by Lancelot »

Re: Additional fonts
« Reply #9 on: June 07, 2012, 10:05:17 AM »

ChrisR

  • XPE Baker
  • Grand Chef
  • *****
  • Date Registered: Mar 2011
  • Posts: 3494
Unfortunately, there is no universal font for all locations.

The font defined in System\ControlSet001\Control\Nls\CodePage,OEMHAL, is essential to start (vgaoem.fon for me).
otherwise we get the error "Failed to load windows because the NLS data is missing or damaged"

To display the characters correctly in windows console, PowerShell, cmd.exe, and , 
we must add the fonts defined in the following key:
software\Microsoft\Windows NT\CurrentVersion\Console\RasterFonts
software\Microsoft\Windows NT\CurrentVersion\Console\TrueTypeFont (lucida conole lucon.ttf)
software\Microsoft\Windows NT\CurrentVersion\GRE_Initialize\LargeFont
software\Microsoft\Windows NT\CurrentVersion\GRE_Initialize\SmallFont

which gives for me
Quote
8514fix.fon, 8514oem.fon, 8514sys.fon, app850.fon, cga40woa.fon, cga80woa.fon, ega40woa.fon, ega80woa.fon, lucon.ttf, vga850.fon, vgafix.fon, vgaoem.fon, vgasys.fon (140 Kb)
by testing it seems sufficient, but the display is not the prettiest and it may miss certain fonts for some other apps.
How have you identify those fonts that does not seem really useful ?

Is it worth to add an option (minimum fonts) in order to have only those fonts and save 13.8 Mb (~4.8 compressed) of font copied from BootSrc,  I don't really know.

:cheers:

Re: Additional fonts
« Reply #10 on: June 07, 2012, 04:09:34 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
Yes Chris,

vgaoem.fon is The Critical, minor difference on Gena it is not under Fonts ;)
I feel similarities continues so here is some additional info, for only informative:
+
marlett.ttf is for symbols you see all around  :wink:
+
System font settings location, and relevant font would be useful for gui apps:
[HKEY_LOCAL_MACHINE\Tmp_Software\Microsoft\Windows NT\CurrentVersion\FontSubstitutes]
"MS Shell Dlg 2"=
(Generally Tahoma , but may/maynot ! change with other languages)
+
"MS Shell Dlg"  is for backward compatibilty for pre xp/2k3 systems.
+
.fon files are main responsible for languages, others for gui (as far as I practiced)

Is it worth to add an option
As I wrote, I do not think it is worth, since Win7PE SE never had such goals  :thumbsup:

 :cheers:

Re: Additional fonts
« Reply #11 on: June 08, 2012, 08:37:14 PM »

Mikka

  • Code Baker
  • Chef
  • ***
  • Location: Germany
  • Date Registered: May 2012
  • Posts: 256
Well, I knew some .fon and .ttf are crucial (i.e. .fons, Courier New, MS Sans Serif...) but the majority of the newly available .ttfs are superfluous, aren't they?
Basically, what I could try is editing the file boot.wim and delete some of the fonts in there, no?

Re: Additional fonts
« Reply #12 on: June 08, 2012, 08:46:37 PM »

Lancelot

  • Gena Baker
  • Grand Chef
  • *****
  • Date Registered: Sep 2010
  • Posts: 10350
write a custom plugin to delete the things you want
ex:
FileDelete,%Target_Win%\Fonts\blabla.ttf
...
 :cheers:

Re: Additional fonts
« Reply #13 on: June 21, 2012, 07:58:21 PM »

Mikka

  • Code Baker
  • Chef
  • ***
  • Location: Germany
  • Date Registered: May 2012
  • Posts: 256
Yes, Lancelot, thanks to your help (for instance great utils!) I'm getting more proficient (slowly).
It's on my agenda (category: nice to have/what else), currently I'm busy getting stuff done like a hosts importer etc.

Re: Additional fonts
« Reply #14 on: July 18, 2012, 12:55:00 PM »

Mikka

  • Code Baker
  • Chef
  • ***
  • Location: Germany
  • Date Registered: May 2012
  • Posts: 256
Just for the record, I removed all the unneeded font stuff, but I agree with ChrisR that
Quote from: ChrisR
"Additional Fonts" […] is a joke
—unfortunately ...

I wanted to profit from it by integrating .otf files (available here) to my PE build, didn't work...

I'm no AutoIt adept, but looking over the source, could it be that otf fonts aren't recognized...?
By the way, in order to perform the font addition from scratch, what do I have to consider?
A simple font file copy to %target_sys%\Fonts won't do, will it?
:huh:

 

Powered by EzPortal