Community
DWF
cancel
Showing results for 
Show  only  | Search instead for 
Did you mean: 

DWF Toolkit 7.7 rotate text.

3 REPLIES 3
Reply
Message 1 of 4
StanislavB
795 Views, 3 Replies

DWF Toolkit 7.7 rotate text.

I extracted from plan of font data. Font contains the angle of rotation of the text data. Returns the font rotation in 360/65636ths of a degree.

Some text in plan rotated 90 degrees (rotation = 16383), but my code extracts from the plan file rotation = 0.
Here is my code:

 

do
{
  result = _pFile->process_next_object();
  if ((result == WT_Result::Success || result == WT_Result::End_Of_DWF_Opcode_Found))
  {
    WT_Object* pCurrObject = _pFile->object();
    WT_Object::WT_ID objectId = pCurrObject->object_id();
    int rotation;
    switch (objectId)
    {
      case WT_Object::Text_ID:
      {
        WT_Text* pText = (WT_Text*)pCurrObject;
        WT_Logical_Point textPosition = pText->position();
        std::string chars = dwfReaderUtils::WTstringToString(_pText->string());
        std::cout << "Text: " << chars << " Rotate: " << rotation << std::endl;
        break;
      }
      case WT_Object::Font_ID:
      {
        WT_Font* pFont = (WT_Font*)pCurrObject;
        rotation = pFont->rotation().rotation();
        break;
      }
    }
  }
}


I also tried to extract the rotation angle of the text as follows:

 

WT_Rendition & rendition = _pFile-> rendition ();
const WT_Font & wtFont = rendition.font ();
rotation = wtFont.rotation (). rotation ();

 

But the result was the same.
Maybe someone knows how fix this problem? Help me.

 

Stas.

3 REPLIES 3
Message 2 of 4
bkdi
in reply to: StanislavB

The same problem, is there information about text rotation in other place than WT_Font?

Message 3 of 4
bkdi
in reply to: bkdi

The WT_Font_Option_Flags flags topic is the answer for above questions.

Message 4 of 4
geotavros
in reply to: bkdi

Are there other entities or settings that influence text rotation? 

 

In the file attached by OP there is no WT_Font_Option_Flags entity. Thus using font's rotation attribute leads to incorrect text rendering. 

What else influences text's rotation?

 

Can WT_Object_Node somehow influence text's rotation?

Can't find what you're looking for? Ask the community or share your knowledge.

Post to forums  

”Boost

 

”Tips

 

”Services