On Fri, 2006-09-08 at 13:48 +0200, Alan Yaniger wrote: > Hi Caolan, > > I appreciate your guidance here. Yes, in my Word document, the CTL font > is set higher up in the chain. "Header 1" inherits from "Header" which > inherits from "Normal", which is where the CTL font is set. But > curiously, I found that if in Word I change the CTL font in "Normal" to > the Hebrew font "Miriam", a hex dump on the doc file shows one less > 0x4a5E "srpm" than if I change it to any other font. And indeed I found > that when importing the file with "Miriam" to OOo, there is one less > call to Read_FontCode. As a result, the variable "bCTLFontChanged" is > "false" when WW8RStyle::Set1StyleDefaults() is called, and OOo sets the > display font to OOo's default CTL font instead of to "Miriam". > > Do you know why MS Word is saving the file this way when the font is > "Miriam"? Might "Miriam" be defined in some other setting, and Word > thinks that "Normal" is getting the font from there?
That's excellent work. Now, the default style can have its fontid set, but if the fontid is *not* set, then we look to the default fontids for the MSWord stylesheet that owns these styles, this is "rgftcStandardChpStsh" and is read in ww8scan.cxx, see "ftcStandardChpCTLStsh" for what is the CTL one (or what we *think* is the CTL one) If the internal MSWord default font is Miriam, it is possibly the case that Word doesn't set this even in the "Normal" style as it is the same as the root MSWord CTL font, and that the "default CTL font" is expected to be used. What I'd expect to see here is something being set for the ftcStandardChpCTLStsh value, can you use your debugger, or some printf's to see if... a) ftcStandardChpCTLStsh gets set to some value when your document is loaded ?, and if so what the value is. This value is just an index into the font list. Where the problem is likely to be that either, a) this number is not being read, or is read incorrectly b) the number is correct, but the list of fontnames was read incorrectly and they don't match c) word has some ugly hack of some kind which hardcodes the root default CTL font to Miriam d) something else WW8Fonts::WW8Fonts is where we read in this list of fontnames and the fontid is a simple index into that list. So the other thing to do is to debug there and see what fonts this document contains, and what their indexes are. What we're really looking for here is to see if Miriam is in this fontlist, and what index in the fontlist it is. Ideally the index in this fontlist in WW8Fonts::WW8Fonts for "Miriam" is the same as the value for ftcStandardChpCTLStsh. But now we need to know if Miriam is missing from this list or not, and what value for ftcStandardChpCTLStsh was set. One possibility, but it's very speculative, is that in ww8scan.cxx WW8Style::WW8Style ftcStandardChpCTLStsh is not read from the MSWord document at all because the particular version of word you have writes a short header with no default CTL fontid value, and what we should do in this case is take the Western fontid. But that's purely an idea. More data is needed as to what fonts WW8Fonts::WW8Fonts sees, and what index is read for ftcStandardChpStsh and ftcStandardChpCTLStsh C. --------------------------------------------------------------------- To unsubscribe, e-mail: [EMAIL PROTECTED] For additional commands, e-mail: [EMAIL PROTECTED]
