On Thu, 12 Oct 2000, Dom Lachowicz wrote:
Hi,
Yes, this change in behaviour is due to megapatch, I'm sorry.
It's due to the changes in xap_UnixFont.cpp:getMetricsData() - I disabled
the use of 'FontMappingTable' (association between adobe glyph name and
unicode value), and since font shipped with AW don't have their glyphs
ordered as letters in ISO-8859-1, this problem arises (characters with value
> 252 are substituted with small circle, like u with dieresis).
I'm attaching a fix for this. This fix restores by-name mapping of characters
if current encoding is iso8859-1 or cp1252. I've tried this text document -
all characters printed fine.
> Hi,
>
> I have an ABW document with German umlauts (���) and the s-set(�). When I
> print, I get is this character: "�"
>
> This didn't happen before the megapatch. Anyone have any ideas as to why
> this is happening or possible fixes?
>
> http://198.139.111.101/output.ps
> http://198.139.111.101/German215-Aufsatz.abw
>
> Thanks in advance,
> Dom
Best regards,
-Vlad
--- xap_UnixFont.cpp-was Fri Oct 13 13:48:30 2000
+++ xap_UnixFont.cpp Fri Oct 13 13:56:02 2000
@@ -31,6 +31,7 @@
#include "ut_dialogHelper.h"
#include "xap_UnixFont.h"
#include "xap_UnixFontXLFD.h"
+#include "xap_EncodingManager.h"
#define ASSERT_MEMBERS do { UT_ASSERT(m_name); UT_ASSERT(m_fontfile);
UT_ASSERT(m_metricfile); } while (0)
@@ -766,9 +767,14 @@
}
m_uniWidths = (UT_uint16 *) malloc (sizeof (UT_uint16) * 256);
memset (m_uniWidths, 0, 256 * sizeof(UT_uint16)); // Clear array - i would
hope that sizeof(UT_uint16) == 16
- for (UT_sint32 i=0; i != m_metricsData->numOfChars && i<256; ++i)
+ if (XAP_EncodingManager::instance->try_nativeToU(0xa1)==0xa1)
{
-#if 0
+ /* it's iso8859-1 or cp1252 encoding - glyphs in font are in wrong
+ order - we have to map them by name.
+ */
+ for (UT_sint32 i=0; i != m_metricsData->numOfChars && i<256; ++i)
+ {
+
UT_sint32 unicode = -1;
for (UT_uint32 j = 0; the_enc[j].type1_name != NULL; j++)
{
@@ -783,12 +789,21 @@
UT_ASSERT (unicode < 256); // TODO: support multibyte chars
m_uniWidths[unicode] = m_metricsData->cmi[i].wx;
}
-#else
- /*let's assume that we have all characters we need in the font. */
+ }
+ }
+ else
+ {
+ /* it's non-latin1 encoding - we have to assume that order of
+ glyphs in font is correct.
+ */
+ for (UT_sint32 i=0; i != m_metricsData->numOfChars && i<256; ++i)
+ {
if (m_metricsData->cmi[i].code<256 && m_metricsData->cmi[i].code>=0)
m_uniWidths[m_metricsData->cmi[i].code] =
m_metricsData->cmi[i].wx;
-#endif
- }
+
+ };
+ };
+
fclose(fp);