DWF

Reply
New Member
StanislavB
Posts: 1
Registered: ‎04-08-2013
Message 1 of 4 (344 Views)

DWF Toolkit 7.7 rotate text.

344 Views, 3 Replies
09-27-2013 12:37 AM

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::smileyfrustrated:uccess || 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.

Active Member
bkdi
Posts: 6
Registered: ‎08-02-2012
Message 2 of 4 (218 Views)

Re: DWF Toolkit 7.7 rotate text.

03-28-2014 01:33 PM in reply to: StanislavB

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

Active Member
bkdi
Posts: 6
Registered: ‎08-02-2012
Message 3 of 4 (185 Views)

Re: DWF Toolkit 7.7 rotate text.

04-10-2014 02:44 PM in reply to: bkdi

The WT_Font_Option_Flags flags topic is the answer for above questions.

Contributor
geotavros
Posts: 15
Registered: ‎03-27-2012
Message 4 of 4 (166 Views)

What influences text rotation?

04-18-2014 03:53 PM 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?

Announcements
Are you familiar with the Autodesk Expert Elites? The Expert Elite program is made up of customers that help other customers by sharing knowledge and exemplifying an engaging style of collaboration. To learn more, please visit our Expert Elite website.
Need installation help?

Start with some of our most frequented solutions or visit the Installation and Licensing Forum to get help installing your software.