Maxon Developers Maxon Developers
    • Documentation
      • Cinema 4D Python API
      • Cinema 4D C++ API
      • Cineware API
      • ZBrush Python API
      • ZBrush GoZ API
      • Code Examples on Github
    • Forum
    • Downloads
    • Support
      • Support Procedures
      • Registered Developer Program
      • Plugin IDs
      • Contact Us
    • Categories
      • Overview
      • News & Information
      • Cinema 4D SDK Support
      • Cineware SDK Support
      • ZBrush 4D SDK Support
      • Bugs
      • General Talk
    • Unread
    • Recent
    • Tags
    • Users
    • Login

    MoText font family and style problem

    Scheduled Pinned Locked Moved SDK Help
    1 Posts 0 Posters 136 Views
    Loading More Posts
    • Oldest to Newest
    • Newest to Oldest
    • Most Votes
    Reply
    • Reply as topic
    Log in to reply
    This topic has been deleted. Only users with topic management privileges can see it.
    • H Offline
      Helper
      last edited by

      THE POST BELOW IS MORE THAN 5 YEARS OLD. RELATED SUPPORT INFORMATION MIGHT BE OUTDATED OR DEPRECATED

      On 26/01/2012 at 11:28, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   R13 
      Platform:   Windows  ;   
      Language(s) :     C++  ;

      ---------
      Hi,

      I've a small problem with the MoText object.

      If I try to retrieve font family and style names from a MoText object (in a EffectorData plugin), this fails until the user selects at least once a font. Beforehand one seems to have to fall back to the default font.

      This code which works for me (called in InitPoints()), feels a bit ugly:

        
      GeData d;  
      FontData *fd;  
      BaseContainer bcFont;  
        
      if (!bcDataGenerator->GetParameter(DescLevel(PRIM_TEXT_FONT), d)) {  
      // error handling  
      }  
      fd = (FontData* )d.GetCustomDataType(FONTCHOOSER_DATA);  
      if (!fd) {  
      // error handling  
      }  
      bcFont = fd->GetFont();  
      if ( (!GeClipMap::GetFontName(&bcFont, GE_FONT_NAME_FAMILY, &sNameFamilyC4D)) &&  
      ( (!GeClipMap::GetDefaultFont(GE_FONT_DEFAULT_SYSTEM, &bcFont)) ||  
      (!GeClipMap::GetFontName(&bcFont, GE_FONT_NAME_FAMILY, &sNameFamilyC4D)) ) ) {  
      // Now here we have always info on font family and style  
      // also if the MoText just go freshly created  
      }  
      

      So this works, but I'd like to get rid of the GetDefaultFont() stuff.

      Best regards,
      Andreas

      1 Reply Last reply Reply Quote 0
      • First post
        Last post