[Fonts] fonts.alias with ttf fonts problems.

2003-02-06 Thread H Brett Bolen
I have font aliases defined in the fonts.alias file:

[root@narl rtf]# cat fonts.alias
MilStd2525-adobe-MIL_STD_2525b-medium-r-normal--0-0-0-0-p-0-iso8859-1
NTDSSymbols   -adobe-MIL_STD_2525b-medium-r-normal--0-0-0-0-p-0-iso8859-1
MilStd2525-12 -adobe-MIL_STD_2525b-medium-r-normal--12-0-0-0-p-0-iso8859-1
MilStd2525-14 -adobe-MIL_STD_2525b-medium-r-normal--14-0-0-0-p-0-iso8859-1
MilStd2525-16 -adobe-MIL_STD_2525b-medium-r-normal--16-0-0-0-p-0-iso8859-1
MilStd2525-18 -adobe-MIL_STD_2525b-medium-r-normal--18-0-0-0-p-0-iso8859-1
MilStd2525-20 -adobe-MIL_STD_2525b-medium-r-normal--20-0-0-0-p-0-iso8859-1
MilStd2525-24 -adobe-MIL_STD_2525b-medium-r-normal--24-0-0-0-p-0-iso8859-1
MilStd2525-40 -adobe-MIL_STD_2525b-medium-r-normal--40-0-0-0-p-0-iso8859-1
MilStd2525-30 -adobe-MIL_STD_2525b-medium-r-normal--30-0-0-0-p-0-iso8859-1
HelvBold12   -adobe-helvetica-bold-r-normal--12-120-75-75-p-70-iso8859-1
HelvBold14   -adobe-helvetica-bold-r-normal--14-140-75-75-p-82-iso8859-1
HelvBold18   -adobe-helvetica-bold-r-normal--18-180-75-75-p-103-iso8859-1


The MilStd2525 files are ttf and the HelvBold files are the regular fonts.

For some reason, I see the HelBold fonts, but not the MilStd fonts.  both
of the long font names are shown in xlsfonts.

Is there a problem with ttf font aliases?  I'm using rh7.2 and rh7.3
(  xfree 4.1.0 and xfree 4.2.0) -- it is weird because it works with some
machines but not others.

thanks
--
b²

---
-- H Brett Bolen
-- TCNi
-- Phone: 919 550-0828
-- eFax : 509 752-8446



___
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts



[Fonts] Re: Unsafe chars in Mkfontscale

2003-02-06 Thread Mike FABIAN
Juliusz Chroboczek <[EMAIL PROTECTED]> $B$5$s$O=q$-$^$7$?(B:
(B
(B> Would you be so kind as to test the attached patch and confirm that it
(B> does what you want?  It's rather urgent, I'd like it to go into 4.3.
(B
(BThere is a 'i++;' too much:
(B
(B+ for(i = 0; i < len; i++) {
(B+ if(unsafe(s[i]))
(B+ t[i] = ' ';
(B+ else
(B+ t[i] = s[i];
(B+ i++;  <- too much
(B+ }
(B
(Band the '-' character is missing in the list of unsafe chars:
(B
(B+ static int
(B+ unsafe(char c)
(B+ {
(B+ return 
(B+ c < 0x20 || c > 0x7E ||
(B+ c == '[' || c == ']' || c == '(' || c == ')' || c == '\\';
(B+ }
(B
(B-- 
(BMike Fabian   <[EMAIL PROTECTED]>   http://www.suse.de/~mfabian
$B?gL2ITB-$O;E;v$NE($@!#(B
(B___
(BFonts mailing list
([EMAIL PROTECTED]
(Bhttp://XFree86.Org/mailman/listinfo/fonts



[Fonts] Re: Unsafe chars in Mkfontscale

2003-02-06 Thread Mike FABIAN
Juliusz Chroboczek <[EMAIL PROTECTED]> $B$5$s$O=q$-$^$7$?(B:
(B
(B> Would you be so kind as to test the attached patch and confirm that it
(B> does what you want?  It's rather urgent, I'd like it to go into 4.3.
(B>
(B> I'm cut off from CVS right now, sorry if it doesn't apply cleanly.
(B
(BApplies cleanly but doesn't work. Checking ...
(B
(B-- 
(BMike Fabian   <[EMAIL PROTECTED]>   http://www.suse.de/~mfabian
$B?gL2ITB-$O;E;v$NE($@!#(B
(B___
(BFonts mailing list
([EMAIL PROTECTED]
(Bhttp://XFree86.Org/mailman/listinfo/fonts



Re: [Fonts] Unsafe chars in Mkfontscale

2003-02-06 Thread Pablo Saratxaga
Kaixo!

On Thu, Feb 06, 2003 at 05:41:03PM +0100, Juliusz Chroboczek wrote:
> Mike,
> 
> Would you be so kind as to test the attached patch and confirm that it
> does what you want?  It's rather urgent, I'd like it to go into 4.3.

I think using '_' instead of ' ' for the "unsafe" chars would be better.

Also, for [ ] ( ) \ I told about them as examples, I don't know if they
are actually problematic, nor if there are others in such case.
(also, what about ' " ` )

> 
> I'm cut off from CVS right now, sorry if it doesn't apply cleanly.
> 
> Juliusz
> 
> 


-- 
Ki ça vos våye bén,
Pablo Saratxaga

http://chanae.walon.org/pablo/  PGP Key available, key ID: 0xD9B85466
[you can write me in Walloon, Spanish, French, English, Italian or Portuguese]



msg01484/pgp0.pgp
Description: PGP signature


Re: [Fonts] Re: mkfontscale and family names which contain '-'

2003-02-06 Thread Pablo Saratxaga
Kaixo!

On Thu, Feb 06, 2003 at 05:55:37PM +0100, Mike FABIAN wrote:

> > In the ttmkfdir version we use we handle such cases by using the postscript
> > name of the font instead, when writting the fonts.dir file; I haven't had
> > any problem so far (several years already doing that).
> 
> Sometimes the PostScript name can also have '-' characters:
> 
> mfabian@magellan:~$ ftdump /usr/X11R6/lib/X11/fonts/truetype/kochi-mincho.ttf | grep 
>postscript
>postscript: Kochi-Mincho

Mmh, indeed.

Note however that the "normal" name has not a "-" but a space; 
so the postscritp name isn't used by my version of ttmkfdir as the
default name is ok to use.

Also, it seems that the thing after the '-' in ps font names is to specify
a different style; "Kochi-Mincho" and "Kochi-Gothic", "MS-Mincho" and
"MS-Gothic" are the 4 only exceptions in all the fonts I have.

Ok, I looked at the sources, and what our version of ttmkfdir does is:

- look at the the English name of the font, for the 'Macintosh' platform,
- if not ok, look at the English name for the 'Windows' platform,
- if not ok, take the psname
- if still not ok, use "unknown" (it could be improved, but until now
  this case has never been reached).

IIRC the reason I changed the default algorithm is that it didn't used
the psname if the font name was wrong, but instead changed the chars
of the string to valid ascii, and in some cases the result was very 
unreadable, while using the psname would ahve given a much better name.

Well, all this is becoming obsolescent anyway (and rightly so! font
handling trough Xft2 is so much easier).

-- 
Ki ça vos våye bén,
Pablo Saratxaga

http://chanae.walon.org/pablo/  PGP Key available, key ID: 0xD9B85466
[you can write me in Walloon, Spanish, French, English, Italian or Portuguese]



msg01483/pgp0.pgp
Description: PGP signature


[Fonts] Unsafe chars in Mkfontscale

2003-02-06 Thread Juliusz Chroboczek
Mike,

Would you be so kind as to test the attached patch and confirm that it
does what you want?  It's rather urgent, I'd like it to go into 4.3.

I'm cut off from CVS right now, sorry if it doesn't apply cleanly.

Juliusz



*** xc/programs/mkfontscale/mkfontscale.c.old	2003-01-27 15:58:08.0 +0100
--- xc/programs/mkfontscale/mkfontscale.c	2003-02-06 17:38:53.0 +0100
***
*** 299,304 
--- 299,345 
  return c;
  }
  
+ static int
+ unsafe(char c)
+ {
+ return 
+ c < 0x20 || c > 0x7E ||
+ c == '[' || c == ']' || c == '(' || c == ')' || c == '\\';
+ }
+ 
+ static char *
+ safe(char* s)
+ {
+ int i, len, safe_flag = 1;
+ char *t;
+ 
+ i = 0;
+ while(s[i] != '\0') {
+ if(unsafe(s[i]))
+ safe_flag = 0;
+ i++;
+ }
+ 
+ if(safe_flag) return s;
+ 
+ len = i;
+ t = malloc(len + 1);
+ if(t == NULL) {
+ perror("Couldn't allocate string");
+ exit(1);
+ }
+ 
+ for(i = 0; i < len; i++) {
+ if(unsafe(s[i]))
+ t[i] = ' ';
+ else
+ t[i] = s[i];
+ i++;
+ }
+ t[i] = '\0';
+ return t;
+ }
+ 
  int
  doDirectory(char *dirname_given)
  {
***
*** 484,489 
--- 525,534 
  if(!adstyle) adstyle = "";
  if(!spacing) spacing = "p";
  
+ /* Yes, it's a memory leak. */
+ foundry = safe(foundry);
+ family = safe(family);
+ 
  for(encoding = encodings; encoding; encoding = encoding->next)
  if(checkEncoding(face, encoding->value)) {
  found = 1;



[Fonts] Re: mkfontscale and family names which contain '-'

2003-02-06 Thread Mike FABIAN
Pablo Saratxaga <[EMAIL PROTECTED]> $B$5$s$O=q$-$^$7$?(B:
(B
(B> In the ttmkfdir version we use we handle such cases by using the postscript
(B> name of the font instead, when writting the fonts.dir file; I haven't had
(B> any problem so far (several years already doing that).
(B
(BSometimes the PostScript name can also have '-' characters:
(B
(Bmfabian@magellan:~$ ftdump /usr/X11R6/lib/X11/fonts/truetype/kochi-mincho.ttf | grep 
(Bpostscript
(B   postscript: Kochi-Mincho
(Bmfabian@magellan:~$
(B
(B-- 
(BMike Fabian   <[EMAIL PROTECTED]>   http://www.suse.de/~mfabian
$B?gL2ITB-$O;E;v$NE($@!#(B
(B___
(BFonts mailing list
([EMAIL PROTECTED]
(Bhttp://XFree86.Org/mailman/listinfo/fonts



Re: [Fonts] mkfontscale and family names which contain '-'

2003-02-06 Thread Pablo Saratxaga
Kaixo!

On Thu, Feb 06, 2003 at 09:52:45AM +0100, Juliusz Chroboczek wrote:
> MF> Maybe one should work around that problem in mkfontscale by replacing
> MF> the '-' characters with ' ', for example like that:
> 
> You're right, of course.  Thanks for the report.

There is also the case of names containing non-ascii, and other special
chars like ( ) [ ] \ etc.

In the ttmkfdir version we use we handle such cases by using the postscript
name of the font instead, when writting the fonts.dir file; I haven't had
any problem so far (several years already doing that).

-- 
Ki ça vos våye bén,
Pablo Saratxaga

http://chanae.walon.org/pablo/  PGP Key available, key ID: 0xD9B85466
[you can write me in Walloon, Spanish, French, English, Italian or Portuguese]



msg01480/pgp0.pgp
Description: PGP signature


[Fonts] Re: where to include ~/.fonts.conf

2003-02-06 Thread Mike FABIAN
James Richard Tyrer <[EMAIL PROTECTED]> $B$5$s$O=q$-$^$7$?(B:
(B
(B> Mike FABIAN wrote:
(B>> I wonder where in /etc/fonts.fonts.conf exactly is the best
(B>> place to put the include statement for ~/.fonts.conf.
(B>> It cannot be at the very end of /etc/fonts/fonts.conf because
(B>> then the following would not work:
(B>
(B> Put it at the end of the list starting with:
(B>
(B>   /usr/X11R6/lib/X11/fonts
(B
(BBut if ~/.fonts.conf is included there (i.e. very early in
(B/etc/fonts/fonts.conf), it is not possible to override the rules from
(B/etc/fonts/fonts.conf in the personal ~/.font.conf file.
(B
(BThe last rule always seems to win.
(B
(BTherefore I wondered whether ~/.fonts.conf should be included
(Bclose to the end of /etc/fonts/fonts.conf. Only a few rules which
(Bdepend on settings in ~/.fonts.conf must be below that, like
(BKeith's method to prefer outline fonts if
(B
(B
(B
(Btrue
(B
(B
(B
(Bis in ~/.fonts.conf.
(B
(B-- 
(BMike Fabian   <[EMAIL PROTECTED]>   http://www.suse.de/~mfabian
$B?gL2ITB-$O;E;v$NE($@!#(B
(B___
(BFonts mailing list
([EMAIL PROTECTED]
(Bhttp://XFree86.Org/mailman/listinfo/fonts



Re: [Fonts] mkfontscale and family names which contain '-'

2003-02-06 Thread Juliusz Chroboczek
MF> Maybe one should work around that problem in mkfontscale by replacing
MF> the '-' characters with ' ', for example like that:

You're right, of course.  Thanks for the report.

I'll change your patch a wee bit: I'll copy the family name instead of
modifying it in place, and I'll do the replacement by hand -- strpbrk
is likely to break some obscure platform or other.

I'll send it in ASAP.

Juliusz



___
Fonts mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/fonts