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
    • Recent
    • Tags
    • Users
    • Login

    Read FontData from text object

    Scheduled Pinned Locked Moved SDK Help
    9 Posts 0 Posters 660 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 03/02/2011 at 07:31, xxxxxxxx wrote:

      User Information:
      Cinema 4D Version:   11.5 
      Platform:      
      Language(s) :   C.O.F.F.E.E  ;

      ---------
      Hello,

      how can I read the font type from the text object?
      I saw something like FontData, but I don't know how it works with the FONT

      CONTAINER BPsplinetext
      {
      ...
      FONT     ID_PAINTSPLINETEXT_FONT  { }
      ...
      }

      together.

      regards
      Marky

      1 Reply Last reply Reply Quote 0
      • H Offline
        Helper
        last edited by

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

        On 03/02/2011 at 08:10, xxxxxxxx wrote:

        The FontData data type, as most custom data types, is not accessible through COFFEE.

        cheers,
        Matthias

        1 Reply Last reply Reply Quote 0
        • H Offline
          Helper
          last edited by

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

          On 03/02/2011 at 23:23, xxxxxxxx wrote:

          oh sorry, I mine in C++ not in COFFEE.

          1 Reply Last reply Reply Quote 0
          • H Offline
            Helper
            last edited by

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

            On 04/02/2011 at 00:41, xxxxxxxx wrote:

            mmh, something is strance with this type.
            If I trying to allocate an object with

            AutoAlloc<FontData> fd;

            I get always an compiler error

            c:\program files\maxon\cinema 4d r11.5\resource\_api\c4d_customdatatype.h(43) : error C2248: 'FontData::FontData' : cannot access private member declared in class 'FontData'
            1>        c:\program files\maxon\cinema 4d r11.5\resource\_api\c4d_customgui\customgui_fontchooser.h(37) : see declaration of 'FontData::FontData'
            1>        c:\program files\maxon\cinema 4d r11.5\resource\_api\c4d_customgui\customgui_fontchooser.h(34) : see declaration of 'FontData'

            What's wrong ?

            1 Reply Last reply Reply Quote 0
            • H Offline
              Helper
              last edited by

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

              On 04/02/2011 at 01:52, xxxxxxxx wrote:

              It's an error in the docs. The FontData class has no Alloc and Free methods.

              To read existing FontData you don't need to allocate it anyway.

              Example:

                
              FontData *fontdata = (FontData* )data->GetCustomDataType(MY_FONT, FONTCHOOSER_DATA);  
                
              ...  
                
              BaseContainer fc = fontdata->GetFont();  
              Filename font = fc.GetFilename(FONT_POSTSCRIPT_NAME);  
              

              cheers,
              Matthias

              1 Reply Last reply Reply Quote 0
              • H Offline
                Helper
                last edited by

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

                On 04/02/2011 at 02:22, xxxxxxxx wrote:

                Hello Matthias,
                ic, the compiler and linker errors are off.
                But I don't get the filename of the font. I get only an empty filename ??

                FontData *fdata = (FontData* )op->GetDataInstance()->GetCustomDataType( TXT_ID_PAINTSPLINETEXT_FONT, FONTCHOOSER_DATA);
                  if (fdata) {
                      BaseContainer fc = fdata->GetFont();
                      Filename font = fc.GetFilename(FONT_POSTSCRIPT_NAME);
                      GePrint("Font: "+ font.GetString());
                }

                1 Reply Last reply Reply Quote 0
                • H Offline
                  Helper
                  last edited by

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

                  On 04/02/2011 at 02:36, xxxxxxxx wrote:

                  I guess it only works with postscript fonts, not True Type.

                  I don't know if it is even possible to retrieve the True Type font. I have to ask the developers.

                  cheers,
                  Matthias

                  1 Reply Last reply Reply Quote 0
                  • H Offline
                    Helper
                    last edited by

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

                    On 04/02/2011 at 02:39, xxxxxxxx wrote:

                    ok, thanks.

                    Marky

                    1 Reply Last reply Reply Quote 0
                    • H Offline
                      Helper
                      last edited by

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

                      On 04/02/2011 at 04:07, xxxxxxxx wrote:

                      Hello Matthias,

                      maybe you can give me an hint about the font topic. My problem is, that I generate an own ObjectData plugin and generate three objects in the GetVirtualObj. function. An null, an Osplinetext and an Oextrude object, because I need the same behaviour like if I would generate this objects by hand. But I can't taken over all properties in the description files, therefore I create my own with some similar properties. And now I must forward all settings into the right basic objects, also the font. Do you have an idea or an proposal, how I can do this (reading the font and put it into the Osplinetext object, that was my idea). But this doesn't works. Maybe the developers has an idea?

                      regards
                      Markus

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