Text element class implementation