2011-02-27

Thank you Amazon!

In this post I'm focusing on Kindle for PC running on Windows XP and the Romanian language.

Windows XP has been able to display correct Romanian characters after Romania joined the European Union in 2007, and it can do this after installing the European Union Expansion Font Update.

Here is a screenshot of Kindle for PC 1.2.1 displaying a book on Windows XP:


Here is a screenshot of Kindle for PC 1.3.0 displaying the same book:


Noticed the squares? They are there because Amazon changed the font (which cannot be changed by user) from Times New Roman to Georgia. Unfortunately Microsoft has not included an updated version of Georgia in the "European Union Expansion Font Update".

Here is a list of options for fixing this squares problem:
  1. Upgrade from Windows XP to a newer Windows operating system
  2. Report the problem to Microsoft and hope for a new version of  "European Union Expansion Font Update"
  3. Report the problem to Amazon and hope for a new version of Kindle for PC

The first option is not always feasible due to old hardware or lack of budget for newer Windows operating systems.

The second option could have worked in 2007, but not in 2011. I'm saying this because the first version of "European Union Expansion Font Update" was dated 8 December 2006 and included font updates for Arial, Times New Roman, and Verdana families. The second version is dated 1 May 2007 which also added the Trebuchet font family to the updated font list.

The third seems the most "doable" of them all. And it was.

Here is a screemshot of Kindle for PC 1.4.1 running on Windows XP:


Amazon reverted the reading font to Times New Roman. Thank you Amazon for listening! (although feedback like "We fixed your problem in version x.y.z" would have been welcomed)

2011-02-09

Reusing bits

I was cleaning my projects directory and I have stumbled upon a small piece of code which I thought might interest others.

The small piece of code was about changing a private data member from outside the object, using normal C++, without using reintepret_cast or hacks like #define class struct


#include <iostream>

class Pi
{
    double pi_;
public:
    Pi() : pi_(3.1514f)
    {
    }

    double GetValue() const
    {
        return pi_;
    }
};

struct Pie
{
    double pie_;
};

int main()
{
    using std::cout;
    using std::endl;

    Pi pi;
   
    cout << "Pi: " << pi.GetValue() << endl;

    Pie* p = new (&pi) Pie;
   
    p->pie_ = 4.0f;

    cout << "Pi: " << pi.GetValue() << endl;
}

I have highlighted the line which does the trick. This trick is called placement new.