Loading ...
Sorry, an error occurred while loading the content.
 

programmatically toggling new/old text metrics

Expand Messages
  • Christopher Golden
    I m wondering how I could go about setting or resetting the flag that corresponds to the Use New Metrics check- box in the CC2 font properties dialog.
    Message 1 of 9 , Mar 25, 2002
      I'm wondering how I could go about setting or resetting
      the flag that corresponds to the "Use New Metrics" check-
      box in the CC2 font properties dialog. Having found out
      that there is no existing macro command allowing this to
      be done, I'm interested in writing a little XP command
      that will do the job.

      Does anyone have any pointers about how one could do this?

      Thanks!
      Christopher Golden
      golden@...
    • Mike Riddle
      The Txt2 entity has a variable TFlags. The TS_METRICS bit is set for new metrics, and clear for old. EStruc.CPY has the base definition for the Txt2 entity,
      Message 2 of 9 , Mar 25, 2002
        The Txt2 entity has a variable TFlags. The TS_METRICS bit is set
        for new metrics, and clear for old. EStruc.CPY has the base definition
        for the Txt2 entity, and Geometry.cpy defines the text geometry flags.

        Mike

        Christopher Golden wrote:

        >I'm wondering how I could go about setting or resetting
        >the flag that corresponds to the "Use New Metrics" check-
        >box in the CC2 font properties dialog. Having found out
        >that there is no existing macro command allowing this to
        >be done, I'm interested in writing a little XP command
        >that will do the job.
        >
        >Does anyone have any pointers about how one could do this?
        >
        >Thanks!
        >Christopher Golden
        >golden@...
        >
        >
        >To Post a message, send it to: cc2-dev-l@...
        >To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...
        >
        >Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/
        >
        >
        >
        >
      • Christopher Golden
        ... Interesting... I had looked in the GEOMTRY.H file for a flag like this, but I see now that it s not defined in the .H, only in the equivalent .CPY. So
        Message 3 of 9 , Mar 25, 2002
          Mike Riddle wrote:

          > The Txt2 entity has a variable TFlags. The TS_METRICS bit is set
          > for new metrics, and clear for old. EStruc.CPY has the base definition
          > for the Txt2 entity, and Geometry.cpy defines the text geometry flags.

          Interesting... I had looked in the GEOMTRY.H file for a flag
          like this, but I see now that it's not defined in the .H,
          only in the equivalent .CPY. So presumably I can simply de-
          fine it for my own purposes as equal to 0x8000?

          At any rate, I don't think I was clear. I'm not actually
          hoping to change existing entities' metrics; I'm instead
          wanting to alter CC2's current text properties, so that any
          future text entities will be created using new metrics.

          In other words, I'm hoping for a "Use New Text Metrics"
          command that would be akin to TSPECF -- but instead of
          changing the currently selected font, it would change the
          currently selected metrics.

          Thanks again,
          Christopher Golden
          golden@...
        • Mike Riddle
          Use DLGetIBAdr,NULL,IB_HDR to get a pointer to the header record. Use the Header.cpy definition of the header structure, (or _HEADER.H) set the TSpec.Flags
          Message 4 of 9 , Mar 25, 2002
            Use DLGetIBAdr,NULL,IB_HDR to get a pointer to the header record.
            Use the Header.cpy definition of the header structure, (or _HEADER.H)
            set the TSpec.Flags TS_METRIC bit. You may need to make some .h
            file changes, as the assembler .cpy definitions are complete, while the
            .h files are only partially complete.

            Mike

            Christopher Golden wrote:
            Mike Riddle wrote:

            The Txt2 entity has a variable TFlags. The TS_METRICS bit is set
            for new metrics, and clear for old. EStruc.CPY has the base definition
            for the Txt2 entity, and Geometry.cpy defines the text geometry flags.

            Interesting... I had looked in the GEOMTRY.H file for a flag
            like this, but I see now that it's not defined in the .H,
            only in the equivalent .CPY. So presumably I can simply de-
            fine it for my own purposes as equal to 0x8000?

            At any rate, I don't think I was clear. I'm not actually
            hoping to change existing entities' metrics; I'm instead
            wanting to alter CC2's current text properties, so that any
            future text entities will be created using new metrics.

            In other words, I'm hoping for a "Use New Text Metrics"
            command that would be akin to TSPECF -- but instead of
            changing the currently selected font, it would change the
            currently selected metrics.

            Thanks again,
            Christopher Golden
            golden@...

            ------------------------ Yahoo! Groups Sponsor ---------------------~-->
            FREE COLLEGE MONEY
            CLICK HERE t o search
            600,000 scholarships!
            http://us.click.yahoo.com/iZp8OC/4m7CAA/ySSFAA/f.ewlB/TM
            ---------------------------------------------------------------------~->

            To Post a message, send it to: cc2-dev-l@...
            To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...

            Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





          • Christopher Golden
            ... This looks very promising. Following your instructions, I am able to read the value of header s TSpec.Flags variable, and write out to it as well.
            Message 5 of 9 , Mar 25, 2002
              Mike Riddle wrote:

              > Use DLGetIBAdr,NULL,IB_HDR to get a pointer to the header record.
              > Use the Header.cpy definition of the header structure, (or _HEADER.H)
              > set the TSpec.Flags TS_METRIC bit. You may need to make some .h
              > file changes, as the assembler .cpy definitions are complete, while the
              > .h files are only partially complete.

              This looks very promising. Following your instructions, I
              am able to read the value of header's TSpec.Flags variable,
              and write out to it as well.

              However, setting or resetting it seems to have no effect
              upon the checkbox in the TSPEC dialog. That is, if I have
              the checkbox checked, and then I run my command and tell it
              to reset the flag, it apparently does, but the state of the
              checkbox shows that the flag is still set when I subsequent-
              ly open the TSPEC dialog.

              This wouldn't bother me too much, except that the value of
              the flag that I've indicated is also not paid attention to
              by CC2 when new text entities are created. :-/

              It appears that the checkbox in the TSPEC dialog is some-
              how connected to a different variable than the TSpec.Flags
              variable of the header block, and furthermore, that CC2 is
              reading the value of the relevant bit in that variable, not
              the one in the header that I'm setting/resetting, when it
              creates text.

              The relevant code from my TSPECNEWMETRICS command is in-
              cluded here:

              header = (HDR*) DLGetIBAdr(NULL, IB_HDR);
              header->TSpec.Flags &= ~TS_METRICS;
              header->TSpec.Flags |= flag;

              (Before this code, "flag" holds the value of either 0 or
              -32768, depending upon whether the command has been told
              to set or reset the new metrics bit.)

              So to sum up, it looks like CC2 is tracking the "use new
              metrics" flag in two different places -- the header block
              as you've shown me, and somewhere else -- and that the
              second one is the one CC2 links with the state of the
              checkbox in the TSPEC dialog, as well as the state of any
              text entities created.

              Is CC2 perhaps caching this value somewhere?

              Thanks again,
              Christopher Golden
              golden@...
            • Mike Riddle
              I ve mostly been working on the V7 core code, so I ve been out of date with CC2 s V6 core. Turns out that V6 does cache the header infoblock only, as it is
              Message 6 of 9 , Mar 25, 2002
                I've mostly been working on the V7 core code, so I've been out of date
                with CC2's V6 core.

                Turns out that V6 does cache the header infoblock only, as it is used in so
                many places. Use the following to get the correct image to change:

                header = (HDR*) GetHeaderAdr();

                Mike

                Christopher Golden wrote:
                Mike Riddle wrote:

                Use DLGetIBAdr,NULL,IB_HDR to get a pointer to the header record.
                Use the Header.cpy definition of the header structure, (or _HEADER.H)
                set the TSpec.Flags TS_METRIC bit. You may need to make some .h
                file changes, as the assembler .cpy definitions are complete, while the
                .h files are only partially complete.

                This looks very promising. Following your instructions, I
                am able to read the value of header's TSpec.Flags variable,
                and write out to it as well.

                However, setting or resetting it seems to have no effect
                upon the checkbox in the TSPEC dialog. That is, if I have
                the checkbox checked, and then I run my command and tell it
                to reset the flag, it apparently does, but the state of the
                checkbox shows that the flag is still set when I subsequent-
                ly open the TSPEC dialog.

                This wouldn't bother me too much, except that the value of
                the flag that I've indicated is also not paid attention to
                by CC2 when new text entities are created. :-/

                It appears that the checkbox in the TSPEC dialog is some-
                how connected to a different variable than the TSpec.Flags
                variable of the header block, and furthermore, that CC2 is
                reading the value of the relevant bit in that variable, not
                the one in the header that I 'm setting/resetting, when it
                creates text.

                The relevant code from my TSPECNEWMETRICS command is in-
                cluded here:

                header = (HDR*) DLGetIBAdr(NULL, IB_HDR);
                header->TSpec.Flags &= ~TS_METRICS;
                header->TSpec.Flags |= flag;

                (Before this code, "flag" holds the value of either 0 or
                -32768, depending upon whether the command has been told
                to set or reset the new metrics bit.)

                So to sum up, it looks like CC2 is tracking the "use new
                metrics" flag in two different places -- the header block
                as you've shown me, and somewhere else -- and that the
                second one is the one CC2 links with the state of the
                checkbox in the TSPEC dialog, as well as the state of any
                text entities created.

                Is CC2 perhaps caching this value somewhere?

                Thanks again,
                Christopher Golden
                golden@...

                ------------------------ Yahoo! Gro ups Sponsor ---------------------~-->
                Buy Stock for $4.
                No Minimums.
                FREE Money 2002.
                http://us.click.yahoo.com/BgmYkB/VovDAA/ySSFAA/f.ewlB/TM
                ---------------------------------------------------------------------~->

                To Post a message, send it to: cc2-dev-l@...
                To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...

                Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





              • Christopher Golden
                ... To make sure that this wasn t a CC2-specific issue, I checked with Profantasy. They did not do any special coding to track the use new metrics flag. I
                Message 7 of 9 , Mar 27, 2002
                  I'm following up my own post here; I had written:

                  > So to sum up, it looks like CC2 is tracking the "use new
                  > metrics" flag in two different places -- the header block
                  > as you've shown me, and somewhere else -- and that the
                  > second one is the one CC2 links with the state of the
                  > checkbox in the TSPEC dialog, as well as the state of any
                  > text entities created.

                  To make sure that this wasn't a CC2-specific issue,
                  I checked with Profantasy. They did not do any
                  special coding to track the "use new metrics" flag.
                  I assume that this means that the flag is actually
                  being tracked in two different places in the core
                  FastCAD engine. Any ideas as to where else I should
                  look to find and manipulate the value of this flag,
                  since the one in the header block does not appear to
                  do anything?

                  Thanks!
                  Chris G.
                  golden@...
                • Mike Riddle
                  Apparently the post I made with the correction failed to get through: The header is cached. To get the cache, use pheader = (HDR*)GetHeaderAdr(); This is the
                  Message 8 of 9 , Mar 27, 2002
                    Apparently the post I made with the correction failed to get through:
                    The header is cached. To get the cache, use pheader = (HDR*)GetHeaderAdr();
                    This is the one being used by the various commands and new entity settings.
                    Mike

                    Christopher Golden wrote:
                    I'm following up my own post here; I had written:

                    So to sum up, it looks like CC2 is tracking the "use new
                    metrics" flag in two different places -- the header block
                    as you've shown me, and somewhere else -- and that the
                    second one is the one CC2 links with the state of the
                    checkbox in the TSPEC dialog, as well as the state of any
                    text entities created.

                    To make sure that this wasn't a CC2-specific issue,
                    I checked with Profantasy. They did not do any
                    special coding to track the "use new metrics" flag.
                    I assume that this means that the flag is actually
                    being tracked in two different places in the core
                    FastCAD engine. Any ideas as to where else I should
                    look to find and manipulate the value of this flag,
                    since the one in the header block does not appear to
                    do anything?

                    Thanks!
                    Chris G.
                    golden@...

                    ------------------------ Yahoo! Groups Sponsor ---------------------~-->
                    Buy Stock for $4.
                    No Minimums.
                    FREE Money 2002.
                    http://us.click.yahoo.com/BgmYkB/VovDAA/ySSFAA/f.ewlB/TM
                    ---------------------------------------------------------------------~->
                    To Post a message, send it to: cc2-dev-l@...
                    To Unsubscribe, send a blank message to: cc2-dev-l-unsubscribe@...

                    Your use of Yahoo! Groups is subject to http://docs.yahoo.com/info/terms/





                  • Christopher Golden
                    ... Hmm, it looks like it. This is the second YahooGroups list I m on that s dropped emails in the past few days. Hopefully this is not a sign of things to
                    Message 9 of 9 , Mar 27, 2002
                      Mike Riddle wrote:

                      > Apparently the post I made with the correction failed to get through:

                      Hmm, it looks like it. This is the second YahooGroups
                      list I'm on that's dropped emails in the past few days.
                      Hopefully this is not a sign of things to come...

                      > The header is cached. To get the cache, use pheader = (HDR*)GetHeaderAdr();
                      > This is the one being used by the various commands and new entity settings.

                      I've just corrected my code, and this works perfectly.
                      Thanks Mike, I appreciate it!

                      Take care,
                      Chris G.
                      golden@...
                    Your message has been successfully submitted and would be delivered to recipients shortly.