Bug#369500: stellarium: Some text cannot be output (missing font?)
Thanks Julien! I looked for this one for a while! Fabien Julien BLACHE a écrit : tags 369500 + patch thanks Hi Cédric, The attached patch fixes two endianness issues in stellarium: - translator.cpp: the resulting UCS4 string was needlessly byteswapped - hip_star.cpp: the floats read from the data file were not byteswapped due to gcc optimizing the macro away (that, or aliasing rules kicking in). The patch does the byteswapping the proper way, using a union (warning: anonymous unions are not be portable to some non-gcc compilers). With these fixes, stellarium works perfectly fine on PPC. (btw, please add the locale files to the stellarium-data package ;) JB. --- stellarium-0.8.0.orig/src/translator.cpp +++ stellarium-0.8.0/src/translator.cpp @@ -114,7 +114,7 @@ ch |= (unsigned short)(utf8[++i]0x3F); } -#ifdef WORDS_BIGENDIAN +#if 0 //def WORDS_BIGENDIAN unicode[j] = bswap_16(ch); #else unicode[j] = ch; --- stellarium-0.8.0.orig/src/hip_star.cpp +++ stellarium-0.8.0/src/hip_star.cpp @@ -145,21 +145,23 @@ // Read datas in binary catalog and compute x,y,z; // The aliasing bug on some architecture has been fixed by Rainer Canavan on 26/11/2003 +// Really ? -- JB, 20060607 int HipStar::read(FILE * catalog) { - float RA=0, DE=0, xDE, xRA; - fread(xRA,4,1,catalog); - LE_TO_CPU_FLOAT(RA, xRA); + union { float fl; unsigned int ui; } RA, DE, LY, xRA, xDE, xLY; - fread(xDE,4,1,catalog); - LE_TO_CPU_FLOAT(DE, xDE); + fread(xRA.ui,4,1,catalog); + LE_TO_CPU_INT32(RA.ui, xRA.ui); + + fread(xDE.ui,4,1,catalog); + LE_TO_CPU_INT32(DE.ui, xDE.ui); // for debug printing - // float rao = RA; - // float deo = DE; + // float rao = RA.fl; + // float deo = DE.fl; -RA*=M_PI/12.; // Convert from hours to rad -DE*=M_PI/180.;// Convert from deg to rad +RA.fl*=M_PI/12.; // Convert from hours to rad +DE.fl*=M_PI/180.;// Convert from deg to rad unsigned short int mag, xmag; fread(xmag,2,1,catalog); @@ -173,7 +175,7 @@ // LE_TO_CPU_INT16(type, xtype); // Calc the Cartesian coord with RA and DE -sphe_to_rect(RA,DE,XYZ); +sphe_to_rect(RA.fl,DE.fl,XYZ); XYZ*=RADIUS_STAR; @@ -198,9 +200,9 @@ setColor(SpType); // Color depending on the spectral type // distance - float LY; - fread(LY,4,1,catalog); - LE_TO_CPU_FLOAT(Distance, LY); + fread(xLY.ui,4,1,catalog); + LE_TO_CPU_INT32(LY.ui, xLY.ui); + Distance = LY.fl; if (mag==0 type==0) return 0;
Bug#369500: stellarium: Some text cannot be output (missing font?)
Fabien Chéreau [EMAIL PROTECTED] wrote: Hi, Thanks Julien! I looked for this one for a while! You're welcome :) Nice app ! :) JB. -- Julien BLACHE [EMAIL PROTECTED] | Debian, because code matters more Debian GNU/Linux Developer| http://www.debian.org Public key available on http://www.jblache.org - KeyID: F5D6 5169 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169
Bug#369500: stellarium: Some text cannot be output (missing font?)
tags 369500 + patch thanks Hi Cédric, The attached patch fixes two endianness issues in stellarium: - translator.cpp: the resulting UCS4 string was needlessly byteswapped - hip_star.cpp: the floats read from the data file were not byteswapped due to gcc optimizing the macro away (that, or aliasing rules kicking in). The patch does the byteswapping the proper way, using a union (warning: anonymous unions are not be portable to some non-gcc compilers). With these fixes, stellarium works perfectly fine on PPC. (btw, please add the locale files to the stellarium-data package ;) JB. -- Julien BLACHE [EMAIL PROTECTED] | Debian, because code matters more Debian GNU/Linux Developer| http://www.debian.org Public key available on http://www.jblache.org - KeyID: F5D6 5169 GPG Fingerprint : 935A 79F1 C8B3 3521 FD62 7CC7 CD61 4FD7 F5D6 5169 --- stellarium-0.8.0.orig/src/translator.cpp +++ stellarium-0.8.0/src/translator.cpp @@ -114,7 +114,7 @@ ch |= (unsigned short)(utf8[++i]0x3F); } -#ifdef WORDS_BIGENDIAN +#if 0 //def WORDS_BIGENDIAN unicode[j] = bswap_16(ch); #else unicode[j] = ch; --- stellarium-0.8.0.orig/src/hip_star.cpp +++ stellarium-0.8.0/src/hip_star.cpp @@ -145,21 +145,23 @@ // Read datas in binary catalog and compute x,y,z; // The aliasing bug on some architecture has been fixed by Rainer Canavan on 26/11/2003 +// Really ? -- JB, 20060607 int HipStar::read(FILE * catalog) { - float RA=0, DE=0, xDE, xRA; - fread(xRA,4,1,catalog); - LE_TO_CPU_FLOAT(RA, xRA); + union { float fl; unsigned int ui; } RA, DE, LY, xRA, xDE, xLY; - fread(xDE,4,1,catalog); - LE_TO_CPU_FLOAT(DE, xDE); + fread(xRA.ui,4,1,catalog); + LE_TO_CPU_INT32(RA.ui, xRA.ui); + + fread(xDE.ui,4,1,catalog); + LE_TO_CPU_INT32(DE.ui, xDE.ui); // for debug printing - // float rao = RA; - // float deo = DE; + // float rao = RA.fl; + // float deo = DE.fl; -RA*=M_PI/12.; // Convert from hours to rad -DE*=M_PI/180.;// Convert from deg to rad +RA.fl*=M_PI/12.; // Convert from hours to rad +DE.fl*=M_PI/180.;// Convert from deg to rad unsigned short int mag, xmag; fread(xmag,2,1,catalog); @@ -173,7 +175,7 @@ // LE_TO_CPU_INT16(type, xtype); // Calc the Cartesian coord with RA and DE -sphe_to_rect(RA,DE,XYZ); +sphe_to_rect(RA.fl,DE.fl,XYZ); XYZ*=RADIUS_STAR; @@ -198,9 +200,9 @@ setColor(SpType); // Color depending on the spectral type // distance - float LY; - fread(LY,4,1,catalog); - LE_TO_CPU_FLOAT(Distance, LY); + fread(xLY.ui,4,1,catalog); + LE_TO_CPU_INT32(LY.ui, xLY.ui); + Distance = LY.fl; if (mag==0 type==0) return 0;
Bug#369500: stellarium: Some text cannot be output (missing font?)
On Tue, Jun 06, 2006 at 10:20:24PM +0200, Cédric Delfosse wrote: That's weird, because the fonts that are used are in fact shipped by the package: - /usr/share/stellarium/data/DejaVuSansMono.ttf - /usr/share/stellarium/data/DejaVuSans.ttf Could you send me a screenshot ? Thanks Thinks are becoming more weird. Shouldn't 'stellarium -h' output something useful? Here is what I get. [EMAIL PROTECTED]:~$ stellarium -h [EMAIL PROTECTED]:~$ Could this be related to my locale/encoding? [EMAIL PROTECTED]:~$ echo $LANG [EMAIL PROTECTED] Uwe -- MMK GmbH, Fleyer Str. 196, 58097 Hagen [EMAIL PROTECTED] Tel: +2331 840446Fax: +2331 843920 signature.asc Description: Digital signature
Bug#369500: stellarium: Some text cannot be output (missing font?)
That's weird, because the fonts that are used are in fact shipped by the package: - /usr/share/stellarium/data/DejaVuSansMono.ttf - /usr/share/stellarium/data/DejaVuSans.ttf Could you send me a screenshot ? Thanks -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#369500: stellarium: Some text cannot be output (missing font?)
OK, I found another ppc user that has the same bug. -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]
Bug#369500: stellarium: Some text cannot be output (missing font?)
Package: stellarium Version: 0.8.0-1 Severity: important Hi, some text is unreadable, e.g. the planet names. Instead of letters there are just rectancles. This looks like a missing font. In the headline of the screen almost everything is readable, except for the coordinates before '@' and after the '('. Uwe -- System Information: Debian Release: testing/unstable APT prefers unstable APT policy: (990, 'unstable'), (500, 'sid'), (500, 'testing'), (500, 'stable') Architecture: powerpc (ppc) Shell: /bin/sh linked to /bin/bash Kernel: Linux 2.6.12-1-powerpc Locale: [EMAIL PROTECTED], [EMAIL PROTECTED] (charmap=ISO-8859-15) (ignored: LC_ALL set to [EMAIL PROTECTED]) Versions of packages stellarium depends on: ii libc6 2.3.6-10 GNU C Library: Shared libraries ii libfreetype62.2.1-2 FreeType 2 font engine, shared lib ii libgcc1 1:4.1.0-4GCC support library ii libgl1-mesa-glx [libgl1]6.4.1-0.4A free implementation of the OpenG ii libglu1-mesa [libglu1] 6.4.1-0.4The OpenGL utility library (GLU) ii libpng12-0 1.2.8rel-5.1 PNG library - runtime ii libsdl-mixer1.2 1.2.6-1.1+b1 mixer library for Simple DirectMed ii libsdl1.2debian 1.2.9-5+b1 Simple DirectMedia Layer ii libstdc++6 4.1.0-4 The GNU Standard C++ Library v3 ii stellarium-data 0.8.0-1 datafiles for Stellarium, a real-t ii zlib1g 1:1.2.3-11 compression library - runtime stellarium recommends no packages. -- no debconf information -- To UNSUBSCRIBE, email to [EMAIL PROTECTED] with a subject of unsubscribe. Trouble? Contact [EMAIL PROTECTED]