This is the mail archive of the binutils@sources.redhat.com mailing list for the binutils project.


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]
Other format: [Raw text]

Re: [PATCH] windres - FONT statement in DIALOGEX resources


Hi Eric,

> The FONT statement in DIALOGEX resources can use up to five parameters. 
> The parameters are:
>   - font height (required)
>   - font name (required)
>   - font weight (optional, only in DIALOGEX)
>   - italic (optional, only in DIALOGEX)
>   - character set (optional, only in DIALOGEX)

Thanks very much - I have now checked your patch in.

> A test case is included.

Excellent.

I do have a couple of points about your patch, which you may find
helpful for future submissions:

> [binutils/ChangeLog]
>          * rcparse.y: Allow two to five parameter in FONT statement of
> DIALOGEX resources.
>          *resbin.c (bin_to_res_dialog): Fixed read/write code for dialogex 
> resource data.

With a ChangeLog entry, please include the name of the person
contributing the change.  In this case it is yourself, but if you
happen to be submitting a change on behalf of someone else, then it
should be their name.  It also helps if the entry follows the format
of other ChangeLog entries, so that I can just cut & paste it into the
repository.  For example all text is tab-indented, and there should
be a single white space between an asterisk at the start of an item
and the item's file.  So the above ChangeLog fragment ought to have
looked like this:

[binutils/ChangeLog]
Eric Kohl <ekohl@rz-online.de>

	* rcparse.y: Allow two to five parameter in FONT statement of 
	DIALOGEX resources.
	* resbin.c (bin_to_res_dialog): Fixed read/write code for dialogex
	resource data.



The other point is that you forgot to update resrc.c to display the
charset field if it has a non-default value.  It should always be
possible to run windres on a compiled binary and retrieve a text
equivalent that will then re-compile to the same binary.  I fixed this
by applying the patch below as the same time as yours.

Cheers
        Nick

[binutils/ChangeLog]
Nick Clifton  <nickc@redhat.com>

	* resrc.c (write_rc_dialog): If charset is non-default value
	display all of the DIALOGEX parameters.

Index: binutils/resrc.c
===================================================================
RCS file: /cvs/src/src/binutils/resrc.c,v
retrieving revision 1.17
diff -c -3 -p -w -r1.17 resrc.c
*** binutils/resrc.c	9 Apr 2002 17:06:12 -0000	1.17
--- binutils/resrc.c	15 Apr 2002 14:09:52 -0000
*************** write_rc_dialog (e, dialog)
*** 2087,2094 ****
        unicode_print (e, dialog->font, -1);
        fprintf (e, "\"");
        if (dialog->ex != NULL
! 	  && (dialog->ex->weight != 0 || dialog->ex->italic != 0))
! 	fprintf (e, ", %d, %d", dialog->ex->weight, dialog->ex->italic);
        fprintf (e, "\n");
      }
  
--- 2087,2097 ----
        unicode_print (e, dialog->font, -1);
        fprintf (e, "\"");
        if (dialog->ex != NULL
! 	  && (dialog->ex->weight != 0
! 	      || dialog->ex->italic != 0
! 	      || dialog->ex->charset != 1))
! 	fprintf (e, ", %d, %d, %d",
! 		 dialog->ex->weight, dialog->ex->italic, dialog->ex->charset);
        fprintf (e, "\n");
      }
  


Index Nav: [Date Index] [Subject Index] [Author Index] [Thread Index]
Message Nav: [Date Prev] [Date Next] [Thread Prev] [Thread Next]