[CONNECT C++] TextBlocks and Creating "Special" characters

In V8i MicroStation, we are using resource fonts that have non-standard characters defined, like a centerline symbol ("L" positioned in the center of a "C"). These symbols do not typically exist in the TrueType fonts. I see that CONNECT can construct any fraction by taking a numerator and denominator text and "stacking" them (offsetting the origins of the respective parts) and creating a TextNode of the parts. So, before I begin to explore the possibility of doing something similar, I just wanted to ask if what I'm going to try might work.

I'm thinking that I can create a TextNode with two pieces of text: "C" and "L". The default mode would be to insert a break (paragraph or line break) to build the TextBlock. Once that is done, I was going to try and re-position the second "run" (i.e. "L") to move it to the center of the "C" and slightly below. I'm not sure I can get to the origin of the run via the API, but that is what the test is about.

I'm exploring how to convert text from resource fonts to TrueType fonts. There are a few "special" resource font symbols that have no equivalent TrueType symbol. However, I *think* I can manually create them. I realize that they may not be "editable" because of the abnormal positioning, but at this point I think I can live with that...

Bruce

Parents
  • Hi Bruce,

    If you are in need of replacing resource fonts, then you may wish to consider these options.

    1. For text (numeric or character) that can be substituted with something resembling a fraction, you can create a TextBlock using/appending of e.g. StackedFractionType::DiagonalBar / DiagonalBarFraction.  Note although (like the Text Editor) you can provide characters to be used for numerator and denominator, with and without horizontal/diagonal separator bar; specifying none does not appear to allow you to re-position/override the default run locations of the numerator/denominator
    2. Create standardized cells (possibly using edit fields or fields) that can fit a variety of needs
    3. Create your own TrueType fonts (as Jon also suggests)

    HTH,
    Bob

    For #1, See: ..\examples\Annotations\TextExample\TextExampleData.cpp:312:        textBlock->AppendStackedFraction (L"151", L"253", StackedFractionType::HorizontalBar, StackedFractionAlignment::Middle);



Reply
  • Hi Bruce,

    If you are in need of replacing resource fonts, then you may wish to consider these options.

    1. For text (numeric or character) that can be substituted with something resembling a fraction, you can create a TextBlock using/appending of e.g. StackedFractionType::DiagonalBar / DiagonalBarFraction.  Note although (like the Text Editor) you can provide characters to be used for numerator and denominator, with and without horizontal/diagonal separator bar; specifying none does not appear to allow you to re-position/override the default run locations of the numerator/denominator
    2. Create standardized cells (possibly using edit fields or fields) that can fit a variety of needs
    3. Create your own TrueType fonts (as Jon also suggests)

    HTH,
    Bob

    For #1, See: ..\examples\Annotations\TextExample\TextExampleData.cpp:312:        textBlock->AppendStackedFraction (L"151", L"253", StackedFractionType::HorizontalBar, StackedFractionAlignment::Middle);



Children
No Data