Skip to content
  • Categories
  • Recent
  • Tags
  • Popular
  • World
  • Users
  • Groups
Skins
  • Light
  • Cerulean
  • Cosmo
  • Flatly
  • Journal
  • Litera
  • Lumen
  • Lux
  • Materia
  • Minty
  • Morph
  • Pulse
  • Sandstone
  • Simplex
  • Sketchy
  • Spacelab
  • United
  • Yeti
  • Zephyr
  • Dark
  • Cyborg
  • Darkly
  • Quartz
  • Slate
  • Solar
  • Superhero
  • Vapor

  • Default (No Skin)
  • No Skin
Collapse
Code Project
CODE PROJECT For Those Who Code
  • Home
  • Articles
  • FAQ
Community
  1. Home
  2. General Programming
  3. C / C++ / MFC
  4. You Ever Wonder Why?

You Ever Wonder Why?

Scheduled Pinned Locked Moved C / C++ / MFC
helpquestion
13 Posts 2 Posters 0 Views 1 Watching
  • 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.
  • L Larry J Siddens

    Thanks Steve, (Quick response too! :-D) I currently have Fengs book and have tried some of examples in the code that I'm doing. I adjusts it too much the other way! Trying to make a WYSIWYG application is not the easiest thing at all. You by chance don't have any examples that I can sneak a peak at do you? Larry Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

    S Offline
    S Offline
    Steve S
    wrote on last edited by
    #4

    Not without enraging at least half a dozen lawyers! You need to check his web site for errata (I think there's one in there from me!), and be aware of using reference (or em square?) fonts to derive size information. Generally, his stuff is fine for all but the pickiest of users, although I have had to do some work on things like breaking strings into paragraphs, lines, and words for formatting purposes. More recently I've worked with FormatRange, having needed RTF editing capabilities for WP like behaviour, and that was an education in itself! Steve S

    L 1 Reply Last reply
    0
    • S Steve S

      Not without enraging at least half a dozen lawyers! You need to check his web site for errata (I think there's one in there from me!), and be aware of using reference (or em square?) fonts to derive size information. Generally, his stuff is fine for all but the pickiest of users, although I have had to do some work on things like breaking strings into paragraphs, lines, and words for formatting purposes. More recently I've worked with FormatRange, having needed RTF editing capabilities for WP like behaviour, and that was an education in itself! Steve S

      L Offline
      L Offline
      Larry J Siddens
      wrote on last edited by
      #5

      Quote
      Not without enraging at least half a dozen lawyers!


      Well, we wouldn't want that now would we? :eek: I will have to see if I have the URL to his web site. Also, you don't have any test programs when you were learning hanging around do you? Those would do. Also, I'm using his "Text.exe" example where you can insert the font and point size to get information about that font. I used the equaion to convert the point size into the logical: Logical = ( point * LOGPIXELSY ) / 72 and found out about the size to enter. Using this information, I'm seeing what happens. The first section adds up correctly. The next character is on smaller, have not done the rest yet... Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

      S L 2 Replies Last reply
      0
      • L Larry J Siddens

        Quote
        Not without enraging at least half a dozen lawyers!


        Well, we wouldn't want that now would we? :eek: I will have to see if I have the URL to his web site. Also, you don't have any test programs when you were learning hanging around do you? Those would do. Also, I'm using his "Text.exe" example where you can insert the font and point size to get information about that font. I used the equaion to convert the point size into the logical: Logical = ( point * LOGPIXELSY ) / 72 and found out about the size to enter. Using this information, I'm seeing what happens. The first section adds up correctly. The next character is on smaller, have not done the rest yet... Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

        S Offline
        S Offline
        Steve S
        wrote on last edited by
        #6

        Well, I wouldn't. Some of my best clients are lawyers... I'll dig around my old backup CDs and see what comes out of it. Have to admit I skimmed through some of his examples, because they weren't relevant to what I needed, or in some cases, I already knew what I was doing (which, it has to be admitted, doesn't happen often!). Good luck Steve S

        1 Reply Last reply
        0
        • L Larry J Siddens

          Quote
          Not without enraging at least half a dozen lawyers!


          Well, we wouldn't want that now would we? :eek: I will have to see if I have the URL to his web site. Also, you don't have any test programs when you were learning hanging around do you? Those would do. Also, I'm using his "Text.exe" example where you can insert the font and point size to get information about that font. I used the equaion to convert the point size into the logical: Logical = ( point * LOGPIXELSY ) / 72 and found out about the size to enter. Using this information, I'm seeing what happens. The first section adds up correctly. The next character is on smaller, have not done the rest yet... Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

          L Offline
          L Offline
          Larry J Siddens
          wrote on last edited by
          #7

          HUMMM. Using Feng's example "Text.exe" I set the font to 62 (the size on the printer in devics units) and I added up the character width for "RIPTION" in bold/italic and this value was 341. I then used the ABC character widths adding up the values and came up with 357! I checked it several times and it was the same. I wonder if the amound (difference) gets to be too big, that it adjusts? Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

          S 1 Reply Last reply
          0
          • L Larry J Siddens

            HUMMM. Using Feng's example "Text.exe" I set the font to 62 (the size on the printer in devics units) and I added up the character width for "RIPTION" in bold/italic and this value was 341. I then used the ABC character widths adding up the values and came up with 357! I checked it several times and it was the same. I wonder if the amound (difference) gets to be too big, that it adjusts? Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

            S Offline
            S Offline
            Steve S
            wrote on last edited by
            #8

            Doesn't surprise me, somehow. This might well account for layout differences in WORD. Although 16/300 of an inch isn't much, over the course of a full line it would increase enough to be noticeable. Steve S

            L 2 Replies Last reply
            0
            • S Steve S

              Doesn't surprise me, somehow. This might well account for layout differences in WORD. Although 16/300 of an inch isn't much, over the course of a full line it would increase enough to be noticeable. Steve S

              L Offline
              L Offline
              Larry J Siddens
              wrote on last edited by
              #9

              Except it is doing it often. I have another that has lots of spaces and it is doing it with the spaces. I'm going to analyis to see where it is doing the adjusting and why. Will post the results. Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

              1 Reply Last reply
              0
              • S Steve S

                Doesn't surprise me, somehow. This might well account for layout differences in WORD. Although 16/300 of an inch isn't much, over the course of a full line it would increase enough to be noticeable. Steve S

                L Offline
                L Offline
                Larry J Siddens
                wrote on last edited by
                #10

                Steve, I think I have found it. When I get the sum (from Feng's reference font) and the actual sum of the fonts being calculated, it seems that when the difference gets bigger than +/-1 it adjusts. I printed out the width being calculated in his KTextFormator::TextOut method along with the actual width from GetCharWidth32. When the sums are within +/-1, there is no adjustment, once it goes over that range it adjusts the output position. Now I need to see if I can implement this and see if it works... Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

                S 1 Reply Last reply
                0
                • L Larry J Siddens

                  Steve, I think I have found it. When I get the sum (from Feng's reference font) and the actual sum of the fonts being calculated, it seems that when the difference gets bigger than +/-1 it adjusts. I printed out the width being calculated in his KTextFormator::TextOut method along with the actual width from GetCharWidth32. When the sums are within +/-1, there is no adjustment, once it goes over that range it adjusts the output position. Now I need to see if I can implement this and see if it works... Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

                  S Offline
                  S Offline
                  Steve S
                  wrote on last edited by
                  #11

                  :sigh: I've now stopped wondering why anything works, and also why it doesn't. Having beaten my head against a brick wall by trying to write a SOAP intercepting ISAPI extension according to the spec provided by one of my temporary colleagues, we're now trying a different approach. I only come to CP as therapy - a kind of schadenfreude I suppose, although it's rewarding to answer or join in another coder's problems and get a result. Steve S

                  L 2 Replies Last reply
                  0
                  • S Steve S

                    :sigh: I've now stopped wondering why anything works, and also why it doesn't. Having beaten my head against a brick wall by trying to write a SOAP intercepting ISAPI extension according to the spec provided by one of my temporary colleagues, we're now trying a different approach. I only come to CP as therapy - a kind of schadenfreude I suppose, although it's rewarding to answer or join in another coder's problems and get a result. Steve S

                    L Offline
                    L Offline
                    Larry J Siddens
                    wrote on last edited by
                    #12

                    Well, kiss my grits! It didn't work! It still spreads out. I still think the best way is to let the rich edit output itself, problem is that I also have other graphic objects that are to be drawn and I think the problem is switching from someother mapping mode back to text. Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

                    1 Reply Last reply
                    0
                    • S Steve S

                      :sigh: I've now stopped wondering why anything works, and also why it doesn't. Having beaten my head against a brick wall by trying to write a SOAP intercepting ISAPI extension according to the spec provided by one of my temporary colleagues, we're now trying a different approach. I only come to CP as therapy - a kind of schadenfreude I suppose, although it's rewarding to answer or join in another coder's problems and get a result. Steve S

                      L Offline
                      L Offline
                      Larry J Siddens
                      wrote on last edited by
                      #13

                      Steve, Have you been able to find any examples (that the lawyers won't complain about) that I can look at? Larry J. Siddens Cornerstone Communications TAME THE DOCUMENT MONSTER www.unifier.biz

                      1 Reply Last reply
                      0
                      Reply
                      • Reply as topic
                      Log in to reply
                      • Oldest to Newest
                      • Newest to Oldest
                      • Most Votes


                      • Login

                      • Don't have an account? Register

                      • Login or register to search.
                      • First post
                        Last post
                      0
                      • Categories
                      • Recent
                      • Tags
                      • Popular
                      • World
                      • Users
                      • Groups