TextAttribute.CHAR_REPLACEMENT question

Discussion in 'Java' started by Ted Hopp, Sep 9, 2003.

  1. Ted Hopp

    Ted Hopp Guest

    I've used TextAttribute.CHAR_REPLACEMENT to insert in-line graphics into
    text by applying it to the Unicode character U+FFFC
    (OBJECT_REPLACEMENT_CHARACTER). But all the layout, measurement, bidi
    analysis, etc. seems to work the same if the underlying character is
    anything else.

    So my question is: when I apply the CHAR_REPLACEMENT attribute to a
    character, does it matter at all what character it is? Do all JVMs behave
    the same in this area?

    The Java documentation isn't exactly clear. The description of
    TextAttribute.CHAR_REPLACEMENT ends with the following strange sentence:
    "Follows the Microsoft model: the character that this is applied to should
    be ?." That seems to say that I should have been using a question mark all
    along instead of U+FFFC. But isn't that contrary to the Unicode standard?

    Thanks,

    Ted Hopp
     
    Ted Hopp, Sep 9, 2003
    #1
    1. Advertising

  2. Ted Hopp

    Steven Coco Guest

    Ted Hopp wrote:

    > The Java documentation isn't exactly clear. The description of
    > TextAttribute.CHAR_REPLACEMENT ends with the following strange sentence:
    > "Follows the Microsoft model: the character that this is applied to should
    > be ?." That seems to say that I should have been using a question mark all
    > along instead of U+FFFC.


    Though I'm not at all familiar with TextAttribute nor performing
    replacements; (!); you will see the ? character used as a replacement
    for characters that can't be found in any of your installed fonts. It
    may also be substituted in other instances when a character is not found
    though I'm not accurate on when. Indulge me for a moment:

    The question mark you're seeing could have been a substitution your web
    browser had made for a character it didn't find in your fonts; but it is
    also possible that it was substituted at some previous time for similar
    reasons.

    The documentation could be referring to some other character.

    .. Steven Coco .
    .........................................................................
    When you're not sure; "Confess your heart" says the Lord, "and you'll be
    freed."
     
    Steven Coco, Sep 10, 2003
    #2
    1. Advertising

  3. Ted Hopp

    Ted Hopp Guest

    "Steven Coco" <> wrote in message
    news:m5w7b.6060$...
    > Ted Hopp wrote:
    >
    > > The Java documentation isn't exactly clear. The description of
    > > TextAttribute.CHAR_REPLACEMENT ends with the following strange sentence:
    > > "Follows the Microsoft model: the character that this is applied to

    should
    > > be ?." That seems to say that I should have been using a question mark

    all
    > > along instead of U+FFFC.

    >
    > Though I'm not at all familiar with TextAttribute nor performing
    > replacements; (!); you will see the ? character used as a replacement
    > for characters that can't be found in any of your installed fonts. It
    > may also be substituted in other instances when a character is not found
    > though I'm not accurate on when. Indulge me for a moment:
    >
    > The question mark you're seeing could have been a substitution your web
    > browser had made for a character it didn't find in your fonts; but it is
    > also possible that it was substituted at some previous time for similar
    > reasons.
    >
    > The documentation could be referring to some other character.


    You're right, but it's not a browser font issue. The source HTML for the
    documentation page contains a question mark. But the comments in the Java
    source contain "...\uFFFC.</TD></TR>". Maybe this is a javadoc issue, where
    it generates a question mark for out-of-range characters?

    In any event, it seems I've been doing it correctly all along, just by
    accident. But I'd still like to know why it apparently works for any (base)
    character at all.

    Ted Hopp
     
    Ted Hopp, Sep 10, 2003
    #3
    1. Advertising

Want to reply to this thread or ask your own question?

It takes just 2 minutes to sign up (and it's free!). Just click the sign up button to choose a username and then you can ask your own questions on the forum.
Similar Threads
  1. sean
    Replies:
    1
    Views:
    629
    Cowboy \(Gregory A. Beamer\)
    Oct 20, 2003
  2. =?Utf-8?B?UnlhbiBTbWl0aA==?=

    Quick Question - Newby Question

    =?Utf-8?B?UnlhbiBTbWl0aA==?=, Feb 14, 2005, in forum: ASP .Net
    Replies:
    4
    Views:
    700
    Iain Norman
    Feb 16, 2005
  3. =?Utf-8?B?YW5kcmV3MDA3?=

    question row filter (more of sql query question)

    =?Utf-8?B?YW5kcmV3MDA3?=, Oct 5, 2005, in forum: ASP .Net
    Replies:
    2
    Views:
    977
    Scott Allen
    Oct 6, 2005
  4. Philip Meyer
    Replies:
    0
    Views:
    450
    Philip Meyer
    Nov 30, 2003
  5. Bit Byte
    Replies:
    1
    Views:
    887
    Teemu Keiski
    Jan 28, 2007
Loading...

Share This Page