Results 1 to 9 of 9

Thread: Strange Font Problem(Resolved)

  1. #1

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Strange Font Problem(Resolved)

    I'm trying to use the First Quarter Moon and Last Quarter Moon symbols from the Wingdings 2 font.
    They look like crescent moons.

    I need a way to acquire them for pasting into an MS Word file.
    But I can't seem to get them.

    If you copy them from the Windows Character Map and paste them into a RichTextBox, they show up properly.
    But if you do an ASC() on the pasted Chars you get an ASCII of 63 for both of them.

    If you try to add Chr$(63) to the RichTextBox you get some other char altogether.

    How the heck do you get them?
    Last edited by longwolf; Jul 2nd, 2005 at 03:50 PM. Reason: Resolved

  2. #2
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Strange Font Problem

    Quote Originally Posted by longwolf
    I'm trying to use the First Quarter Moon and Last Quarter Moon symbols from the Wingdings 2 font.
    They look like crescent moons.

    I need a way to acquire them for pasting into an MS Word file.
    But I can't seem to get them.

    If you copy them from the Windows Character Map and paste them into a RichTextBox, they show up properly.
    But if you do an ASC() on the pasted Chars you get an ASCII of 63 for both of them.

    If you try to add Chr$(63) to the RichTextBox you get some other char altogether.

    How the heck do you get them?

    The problem is that you used a different font.
    If you set a font to Wingdings for the RichTextbox then it will work again.

    The character 63 is used in every font as no font has a unique code and all follow the ASKII characters so change the font to Wingdings and then try it again

    Cheers,

    RyanJ
    My Blog.

    Ryan Jones.

  3. #3

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: Strange Font Problem

    The font is set to Wingdings 2

  4. #4
    Frenzied Member sciguyryan's Avatar
    Join Date
    Sep 2003
    Location
    Wales
    Posts
    1,763

    Re: Strange Font Problem

    Quote Originally Posted by longwolf
    The font is set to Wingdings 2

    Then by converting the ascii from the original character you were given you should be able to get the character you set back.

    If the fonts are the same then using Chr$() to convert th ASCII to a character should work fine.

    Cheers,

    RyanJ
    My Blog.

    Ryan Jones.

  5. #5

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: Strange Font Problem

    I also tried adding this code to the form:
    VB Code:
    1. Private Sub cmd_Click()
    2.     Dim lX As Long
    3.    
    4.     On Error Resume Next ' GoTo Skip:
    5.     RichTextBox.Font = "Wingdings 2"
    6.     For lX = 0 To 512
    7.         RichTextBox.Text = RichTextBox.Text & vbCrLf & Chr$(lX)
    8.         Err.Clear
    9.     Next
    10.  
    11. End Sub

    If you scroll through the chars that make it to the rtb, you will not find those two moons there. :/

  6. #6

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: Strange Font Problem

    Quote Originally Posted by sciguyryan
    Then by converting the ascii from the original character you were given you should be able to get the character you set back.

    If the fonts are the same then using Chr$() to convert th ASCII to a character should work fine.
    Nope, doesn't work.
    I told you this was a strange one

    I'm including the source code for a simple test app.
    The RTB is on the left, a normal txtbox is on the right

    If you can get one of those moons into the rtb without using the Windows Character Map you'll be my hero. LOL
    Attached Files Attached Files

  7. #7

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: Strange Font Problem

    btw,
    I've just been using the debug window to send Chr$()'s to the rtb

  8. #8

  9. #9

    Thread Starter
    Frenzied Member longwolf's Avatar
    Join Date
    Oct 2002
    Posts
    1,343

    Re: Strange Font Problem

    We've have a solution now using Marty's SendKeys.

    Just use:
    VB Code:
    1. Private Sub cmdAction_Click()
    2.        
    3.     RichTextBox1.SetFocus
    4.     SendKeys Chr$(130)
    5. End Sub

    130 was gotten by using the Windoows Character Map and converting the Char's 'Key Code' to decimal.

    Thanks Marty!

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •  



Click Here to Expand Forum to Full Width