Re: mkfontscale strikes again

2003-07-05 Thread Alexander Pohoyda
Egbert Eich [EMAIL PROTECTED] writes:

[...]

  static int doScalable;
  static int doBitmaps;
 -static int doEncodings;
 +static int onlyEncodings;
 +static int onlyEncodings;

A typo?


-- 
Alexander Pohoyda
[EMAIL PROTECTED]
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-03 Thread Egbert Eich
Kean Johnston writes:
  Egbert Eich wrote:
   Juliusz, Kean, please check below and tell me if it does what you expect.
  Mostly, except for the -x stuff. Can you and Juliusz apply and try the 
  attached patch? This doesnt include the X11.tmpl cleanup portion of my 
  original patch, but ti does clean up some missing prototypes and unused 
  variables in mkfontscale, as well as changing the old -x to -a, and 
  making -x be the exclusion suffix.
  

Thanks!

I'm currently running a  'make World' with it. 
As the '-x' option was only added very recently I don't think it
has any negative effect.
Juliusz?
I have your X11.tmpl changes in my tree ready for commit so it
shouldn't get lost.

Egbert.
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-03 Thread Juliusz Chroboczek
RM Weired. I don't see that problem when running mkfontscale
RM (Solaris2.7/SPARC build with Sun Workshop/Forte 7) ...

Try -e.

Juliusz
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-03 Thread Juliusz Chroboczek
KJ I am in favour (personally) of making -x mean eXclude a suffix
KJ and perhaps changing the current mkfontscale's -x to -a, for (a)dd
KJ an encoding.

I agree.

Juliusz
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-03 Thread Juliusz Chroboczek
 From the code I don't see a difference in order between you version
 and Juliusz's either, am I wrong?
KJ No you're not. I didnt know if those semantics were important so I
KJ didn't change them. I am not sure they are important, but since this
KJ is a replacement for mkfontdir, I think it is prudent to err on the
KJ side of caution.

I wouldn't bother.  No strong objection, though.

Juliusz
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-03 Thread Roland Mainz
Juliusz Chroboczek wrote:
 
 RM Weired. I don't see that problem when running mkfontscale
 RM (Solaris2.7/SPARC build with Sun Workshop/Forte 7) ...
 
 Try -e.

That's what I did (% mkfontscale-e $PWD # in the encodings/ dir) ...



Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [EMAIL PROTECTED]
  \__\/\/__/  [EMAIL PROTECTED]
  /O /==\ O\  MPEG specialist, CJAVASunUnix programmer
 (;O/ \/ \O;) TEL +49 641 99-41370 FAX +49 641 99-41359
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-02 Thread Egbert Eich
Juliusz Chroboczek writes:
   What sort of checking was done before replaceing mkfontdir with 
   mkfontscale ?
  
  EE I had the impression that this had been tested to some extend.
  
  Egbert,
  
  I am sorry if I misled you.
  

No problem. I guess it was my mistake.

So far submitted code was thoroughly tested and often heavily modified
by the committers. This has delayed code commit and loaded a overly
hard burdeon on the person who did the commit (in the majority of
cases David, but also Alan, Marc and others).
I would like to get to a situation where the submitter himself 
takes over more responsibilities and takes his code to a committable 
state - if necessary accompanied by an experienced developer.
This would also mean that I'd expect from a contributor with your 
expertise to only submit code he has given some testing himself
unless he says otherwise.
Of course, everybody makes mistakes - I have done a lot lately -
there may always be bugs that fell thru the cracks and nobody expects
submitters to test their code on several different platforms before 
submitting.

You could not know that I would make these assumptions.

  I had tested the mkfontdir replacement on the font directories I hold
  on my laptop.  I did not test this on a tree build, as building a tree
  on my laptop takes a long time and I was busy.
  

Sure, I know this situation.

  It was my impression that I had been clear on this subject in bugzilla #388.
  
http://bugs.xfree86.org/cgi-bin/bugzilla/show_bug.cgi?id=388
  

I'll take a look at this later, thanks.

  I'll try to be even more cautious in the future.
  

Thanks :-)

Egbert.
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-02 Thread Kean Johnston
Egbert Eich wrote:
This is really difficult.
I have compared Julisz's and Kean's patches.
Juliusz doesn't implement the -r option while Kean's code doesn't fix
the '(null)' problem, Kean doesn't generate an encodings file if no
encodings are to be processed while Juliusz generates one containing
a 0.
I could mix both fixes and we may get closer to the truth.
Sorry about that. I made my fix against one that had the NULL problem in 
it. I think we're getting closer though ...

From the code I don't see a difference in order between you version
and Juliusz's either, am I wrong?
No you're not. I didnt know if those semantics were important so I 
didn't change them. I am not sure they are important, but since this is 
a replacement for mkfontdir, I think it is prudent to err on the side of 
caution. You never know what odd behaviour people depend on.

  Please also note that the -x option conflicts with the usage in 
  mkfontdir. In mkfontscale it means add an encoding. In mkfontdir it 
This should definitely be fixed.
Do you want to do it or would you like some help? If the latter, tell me 
what you want to do. Change -x in mkfontscale to be ignore a suffix or 
keep its add an encoding meaning. I am in favour (personally) of 
making -x mean eXclude a suffix and perhaps changing the current 
mkfontscale's -x to -a, for (a)dd an encoding. There is a fair amount of 
momentum in other programs for -x being an exlusion list and -a being an 
append list, so this would retain consistancy, at least from an 
intuitive point of view. But it is also possible there are lots of 
peoples scripts depending on the current mkfontscale -x. You know better 
than I, its your call.

Kean

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-02 Thread Egbert Eich
Kean Johnston writes:
   Yes, if we don't have an improved version by the end of the week
   I will revert this.
  I didnt see any comment on my message ... did you see my patch from 
  yesterday that implements the -r and -n options?
  

I'm sorry I have overlooked your posting.
I've combined Juliusz's and your patch.

Juliusz, Kean, please check below and tell me if it does what you expect.

Egbert.

Index: config/cf/X11.tmpl
===
RCS file: /home/x-cvs/xc/config/cf/X11.tmpl,v
retrieving revision 1.208
diff -u -r1.208 X11.tmpl
--- config/cf/X11.tmpl  27 Jun 2003 14:53:08 -  1.208
+++ config/cf/X11.tmpl  2 Jul 2003 19:16:40 -
@@ -3823,7 +3823,7 @@
 #endif
 #endif
 
-#ifndef MakeTblHtmlDoc(file,srcs)
+#ifndef MakeTblHtmlDoc
 #ifdef HTMLroffCmd
 #define MakeTblHtmlDoc(file,srcs)  @@\
 file.html: srcs@@\
@@ -3835,7 +3835,7 @@
 #endif
 #endif
 
-#ifndef MakeEqnHtmlDoc(file,srcs)
+#ifndef MakeEqnHtmlDoc
 #ifdef HTMLroffCmd
 #define MakeEqnHtmlDoc(file,srcs)  @@\
 file.html: srcs@@\
Index: programs/mkfontscale/mkfontscale.c
===
RCS file: /home/x-cvs/xc/programs/mkfontscale/mkfontscale.c,v
retrieving revision 1.9
diff -u -r1.9 mkfontscale.c
--- programs/mkfontscale/mkfontscale.c  1 Jul 2003 13:05:34 -   1.9
+++ programs/mkfontscale/mkfontscale.c  2 Jul 2003 19:16:52 -
@@ -74,21 +74,24 @@
 
 #define countof(_a) (sizeof(_a)/sizeof((_a)[0]))
 
-int doDirectory(char*, int, ListPtr);
+static int doDirectory(char*, int, ListPtr);
 static int checkEncoding(FT_Face face, char *encoding_name);
 static int checkExtraEncoding(FT_Face face, char *encoding_name, int found);
 static int find_cmap(int type, int pid, int eid, FT_Face face);
 static char* notice_foundry(char *notice);
 static char* vendor_foundry(signed char *vendor);
-int readFontScale(HashTablePtr entries, char *dirname);
+static int readFontScale(HashTablePtr entries, char *dirname);
 ListPtr makeXLFD(char *filename, FT_Face face, int);
+static int readEncodings(ListPtr encodings, char *dirname);
 
 static FT_Library ft_library;
 static float bigEncodingFuzz = 0.02;
 
+static int relative;
 static int doScalable;
 static int doBitmaps;
-static int doEncodings;
+static int onlyEncodings;
+static int onlyEncodings;
 static ListPtr encodingsToDo;
 static int reencodeLegacy;
 char *encodingPrefix = NULL;
@@ -99,7 +102,7 @@
 fprintf(stderr, 
 mkfontscale [ -b ] [ -s ] [ -o filename ] \n
 [ -x encoding ] [ -f fuzz ] [ -l ] 
-[ -e directory ] [ -p prefix ]\n
+[ -e directory ] [ -p prefix ] [ -n ] [ -r ] \n
 [ directory ]...\n);
 }
 
@@ -108,7 +111,7 @@
 {
 int argn;
 FT_Error ftrc;
-int rc;
+int rc, ll = 0;
 char prefix[NPREFIX];
 
 if(getcwd(prefix, NPREFIX - 1) == NULL) {
@@ -117,6 +120,7 @@
 }
 if(prefix[strlen(prefix) - 1] != '/')
 strcat(prefix, /);
+encodingPrefix = dsprintf(%s, prefix);
 
 outfilename = NULL;
 
@@ -127,8 +131,9 @@
NULL, 0);
 doBitmaps = 0;
 doScalable = 1;
+onlyEncodings = 0;
+relative = 0;
 reencodeLegacy = 1;
-doEncodings = 0;
 encodingsToDo = NULL;
 
 argn = 1;
@@ -154,14 +159,14 @@
 usage();
 exit(1);
 }
-strcpy(prefix, argv[argn + 1]);
+free(encodingPrefix);
+encodingPrefix = dsprintf(%s, argv[argn + 1]);
 argn += 2;
 } else if(strcmp(argv[argn], -e) == 0) {
 if(argn = argc - 1) {
 usage();
 exit(1);
 }
-doEncodings = 1;
 rc = readEncodings(encodingsToDo, argv[argn + 1]);
 if(rc  0)
 exit(1);
@@ -172,6 +177,12 @@
 } else if(strcmp(argv[argn], -s) == 0) {
 doScalable = 0;
 argn++;
+} else if(strcmp(argv[argn], -n) == 0) {
+onlyEncodings = 1;
+argn++;
+} else if(strcmp(argv[argn], -r) == 0) {
+relative = 1;
+argn++;
 } else if(strcmp(argv[argn], -l) == 0) {
 reencodeLegacy = !reencodeLegacy;
 argn++;
@@ -199,8 +210,6 @@
 }
 }
 
-encodingPrefix = dsprintf(%s, prefix);
-
 if(outfilename == NULL) {
 if(doBitmaps)
 outfilename = fonts.dir;
@@ -213,13 +222,14 @@
 fprintf(stderr, Could not initialise FreeType library: %d\n, ftrc);
 exit(1);
 }
-
+
+ll = listLength(encodingsToDo);
 
 if (argn == argc)
-doDirectory(., doEncodings, encodingsToDo);
+doDirectory(., ll, encodingsToDo);
 

Re: mkfontscale strikes again

2003-07-02 Thread Roland Mainz
Dr Andrew C Aitchison wrote:
 
 With Roland's fix, mkfontscale generates encodings.dir files
 containing the string (null), ie with lines like:
 
 big5-0 (null)(null)large/big5.eten-0.enc
 big5.eten-0 (null)large/big5.eten-0.enc
 viscii1.1-1 (null)./viscii1.1-1.enc.gz
 adobe-symbol (null)./adobe-symbol.enc.gz

Weired. I don't see that problem when running mkfontscale
(Solaris2.7/SPARC build with Sun Workshop/Forte 7) ...



Bye,
Roland

-- 
  __ .  . __
 (o.\ \/ /.o) [EMAIL PROTECTED]
  \__\/\/__/  [EMAIL PROTECTED]
  /O /==\ O\  MPEG specialist, CJAVASunUnix programmer
 (;O/ \/ \O;) TEL +49 641 99-41370 FAX +49 641 99-41359
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-01 Thread Juliusz Chroboczek
AA What sort of checking was done before replaceing mkfontdir with 
AA mkfontscale ?

None; there's been a problem of assignment of responsibility.

Please see bug 388, where I'm assuming somebody will do the testing
before committing (or decide not to commit until there's testing), and
Egbert assumes I did the testing.

AA Is there a realistic prospect of testing and fixing this
AA properly within say a week ?

I've scheduled Wednesday evening (CEST) for that.  Might have some
time tonight, no promises though.

Juliusz


___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-01 Thread Egbert Eich
Dr Andrew C Aitchison writes:
  With Roland's fix, mkfontscale generates encodings.dir files
  containing the string (null), ie with lines like:
  
  big5-0 (null)(null)large/big5.eten-0.enc
  big5.eten-0 (null)large/big5.eten-0.enc
  viscii1.1-1 (null)./viscii1.1-1.enc.gz
  adobe-symbol (null)./adobe-symbol.enc.gz
  
  The following diff seems to remove the nulls;
  any idea whether this is the right solution ?

Juliusz?

  
  diff -u -r1.8 mkfontscale.c
  --- mkfontscale.c   2003/06/30 16:52:57 1.8
  +++ mkfontscale.c   2003/07/01 11:58:19
  @@ -1203,7 +1203,7 @@
   continue;
   
   for(name = names; *name; name++) {
  -if(fullname[0] != '/') {
  +if(encodingPrefix  fullname[0] != '/') {
   char *n;
   n = dsprintf(%s%s, encodingPrefix, fullname);
   if(n == NULL) {
  
  
  What sort of checking was done before replaceing mkfontdir with 
  mkfontscale ?

I had the impression that this had been tested to some extend.
Otherwise I wouldn't have committed the fixes.
Appearantly is had not been tested thoroughly.

  
  Is there a realistic prospect of testing and fixing this
  properly within say a week ?
  If not, I'd like to revert to building the real mkfontdir app and
  having a build option to use one or the other when making XFree86.
  

Yes, if we don't have an improved version by the end of the week
I will revert this.
Having build options for all kinds of experimental stuff doesn't
sound like a realistic solution. Better to have some sandbox
separate from the main tree.

Egbert.
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-01 Thread Juliusz Chroboczek
 What sort of checking was done before replaceing mkfontdir with 
 mkfontscale ?

EE I had the impression that this had been tested to some extend.

Egbert,

I am sorry if I misled you.

I had tested the mkfontdir replacement on the font directories I hold
on my laptop.  I did not test this on a tree build, as building a tree
on my laptop takes a long time and I was busy.

It was my impression that I had been clear on this subject in bugzilla #388.

  http://bugs.xfree86.org/cgi-bin/bugzilla/show_bug.cgi?id=388

I'll try to be even more cautious in the future.

Juliusz
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-01 Thread Dr Andrew C Aitchison
On Tue, 1 Jul 2003, Egbert Eich wrote:

 Having build options for all kinds of experimental stuff doesn't
 sound like a realistic solution. Better to have some sandbox
 separate from the main tree.

True.
If we had known that this was experimental, a branch of the CVS tree
would have made sense.

-- 
Dr. Andrew C. Aitchison Computer Officer, DPMMS, Cambridge
[EMAIL PROTECTED]   http://www.dpmms.cam.ac.uk/~werdna

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-01 Thread Juliusz Chroboczek
AA any idea whether this is the right solution ?

Please try the attached instead.

Juliusz

Index: xc/programs/mkfontscale/mkfontscale.c
===
RCS file: /cvs/xc/programs/mkfontscale/mkfontscale.c,v
retrieving revision 1.9
diff -u -r1.9 mkfontscale.c
--- xc/programs/mkfontscale/mkfontscale.c	2003/07/01 13:05:34	1.9
+++ xc/programs/mkfontscale/mkfontscale.c	2003/07/01 19:19:32
@@ -117,6 +117,7 @@
 }
 if(prefix[strlen(prefix) - 1] != '/')
 strcat(prefix, /);
+encodingPrefix = dsprintf(%s, prefix);
 
 outfilename = NULL;
 
@@ -154,7 +155,8 @@
 usage();
 exit(1);
 }
-strcpy(prefix, argv[argn + 1]);
+free(encodingPrefix);
+encodingPrefix = dsprintf(%s, argv[argn + 1]);
 argn += 2;
 } else if(strcmp(argv[argn], -e) == 0) {
 if(argn = argc - 1) {
@@ -199,8 +201,6 @@
 }
 }
 
-encodingPrefix = dsprintf(%s, prefix);
-
 if(outfilename == NULL) {
 if(doBitmaps)
 outfilename = fonts.dir;
@@ -1211,10 +1211,12 @@
 closedir(dirp);
 return -1;
 }
-free(fullname);
-fullname = n;
+encodingsToDo = listConsF(encodingsToDo, %s %s, *name, n);
+free(n);
+} else {
+encodingsToDo = 
+listConsF(encodingsToDo, %s %s, *name, fullname);
 }
-encodingsToDo = listConsF(encodingsToDo, %s %s, *name ,fullname);
 if(encodingsToDo == NULL) {
 fprintf(stderr, Couldn't allocate encodings\n);
 closedir(dirp);


Re: mkfontscale strikes again

2003-07-01 Thread Juliusz Chroboczek
Please test

  http://bugs.xfree86.org/cgi-bin/bugzilla/show_bug.cgi?id=425

Juliusz
___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel


Re: mkfontscale strikes again

2003-07-01 Thread Kean Johnston
Juliusz Chroboczek wrote:
Please test

  http://bugs.xfree86.org/cgi-bin/bugzilla/show_bug.cgi?id=425
This fixes the -n -r problems for me, and compiles OK. However, are you 
trying to emulate the exact semantic behavious of mkfontdir? If so then 
the way you implement doEncodings is incorrect. In mkfontdir, it first 
does the unlink (removing the file) and then creates it if there are 
encodings to output. It does this regardless of whether or nor you 
specify -e. If there are no encodings there is no file, not a file with 
just a 0 (which is what will currently be produced). Its ordering is 
also different, which may or may not have an impact. The function that 
produces encodings.dir is only run *after* the font tables are written, 
and only if that work didnt produce an error.

If these semantics are unimportant then ignore the above.

Please also note that the -x option conflicts with the usage in 
mkfontdir. In mkfontscale it means add an encoding. In mkfontdir it 
means ignore the following suffix. This is part of the reason why the 
fonts.dir file created during the build is a little more than double the 
size it needs to be, because -x isn't working. If the -x option is 
really entrenched in mkfontscale, then the mkfontdir wrapper is going to 
have to parse all arguments and convert a -x to some other option that 
does the same thing in mkfontscale. If you dont want to do that work let 
me know I'll happily add both the argument to mkfontscale and the mods 
to the mkfontdir script to cope with it. It would be much easier if we 
can just change the current -x option to be something else though.

Kean

___
Devel mailing list
[EMAIL PROTECTED]
http://XFree86.Org/mailman/listinfo/devel