Vertical text with JTextPane?

I am writing an application for displaying and editing sign language texts using Sutton SignWriting. It is a sign language writing system which enables the Deaf people to write to each other in their own language. And it is language-neutral, that means, all sign languages of the world are supported. Please see http://www.signwriting.org/ if you want to know how Sutton SignWriting looks like.
Sutton SignWriting is often written vertically from top to bottom, because it shows the horizontal location of the gestures better this way. The signs themselves are composited of one to about ten symbols which are placed freely within the sign. A symbol is a hand, a face or just a movement or a contact; they can be rotated or mirrored.
At first I thought I can use the JTextPane. The signs are just JPanels with the symbols painted on it. This idea would work if JTextPane had the ability to switch to vertical text, very much like for Chinese or Japanese. But I didn't find such an ability. Do I really need to implement my own SignWriting text pane? Or do you have a better idea?

Thank you for your suggestion. But I am sorry to tell you that the CodeGuru solution doesn't help me. It is for JLabels but I would like editable vertical text. Any ideas?

Similar Messages

  • How to Type Vertical Text with Boris?

    I need my text to be vertically alligned and move in and out of frame vertically. Is this possible with the Boris Text generator tha comes with FCP 5?
    Thanks,
    Justin!

    Yes, just open Title 3D, type your text, highlight it and click on the 2nd tab (paragraph attributes). Click on 'Text from top"
    Kevan

  • Weird problem with vertical text in a table

    Hello,
    I am new on this forum, usually I don't post because I always find the answer to my question, but this is something quite weird...
    I have a table with vertical text in it (it has to be vertical because the cells are narrow). And I want it to be centered in the cell, both vertically and horizontally. When the cell is high enough, no problem. But as it becomes shorter, the text moves to the left. It is exactly as if there was a right margin within the cell, which is not the case.
    See the example below : I had the text right-aligned (this is to say, bottom-aligned, as it is 270° rotated) to make it more visible.
    Can someone help me there ? I already spent hours on that problem..!
    Thank you very much !

    Only, my table contents both vertical and horizontal text, so I can't. But thanks for the suggestion.
    Thank you kindly for all your answers. Anyway, re-writing the text in separate frames won't be so difficult (anyway it'll always take less time than what that problem already did..).
    So I have a solution, thanks to Phorna
    But remains the frustration of not finding the reason of this ! I will live along with it
    Thanks to all

  • Can i copy copy TEXT with Tag contents from JtextPane

    Hello,
    I want to copy text from jtextpane with Tag contents. I use jtextpane for displaying HTML page. If it is posibile please make a response and how it should be?

    Hi User,
    Please follow the below link:
    http://www.rittmanmead.com/2008/04/migration-obiee-projects-between-dev-and-prod-environments/
    Basically just to give you a heads up, you copy paste the RPD and webcatalog file from your dev instance to same locations in prod instance.
    Award points if your question is answered.
    Thanks,
    -Amith.

  • Problem with vertical text in crystal report viewer

    Hi,
    I am displaying vertical text in crystal report designer and deploying the report in crystal reports server 2008. The deployed report is being displayed using JAVA in crystal report viewer control.
    Problem: Vertical text header  is getting collapsed wth other vertical headers.
    Please help on this.
    Thanks,

    Hi Vijay,
    I found out another method of retaining all the chart formatting that is done in the preview pane.
    Once you have done all the changes then you will find interestingly there is a chart menu option that appears in the tool bar. Once you click on it there is an option "Apply Changes to All Charts".
    Select that option, close your preview. Open it once again and you will find that all the settings are still there and the Web Viewer is able to display them properly.
    I think that I resolved this.
    Regards,
    Gourav

  • Problem with JTextPane and StateInvariantError

    Hi. I am having a problem with JTextPanes and changing only certain text to bold. I am writing a chat program and would like to allow users to make certain text in their entries bold. The best way I can think of to do this is to add <b> and </b> tags to the beginning and end of any text that is to be bold. When the other client receives the message, the program will take out all of the <b> and </b> tags and display any text between them as bold (or italic with <i> and </i>). I've searched the forums a lot and figured out several ways to make the text bold, and several ways to determine which text is bold before sending the text, but none that work together. Currently, I add the bold tags with this code: (note: messageDoc is a StyledDocument and messageText is a JTextPane)
    public String getMessageText() {
              String text = null;
              boolean bold = false, italic = false;
              for (int i = 0; i < messageDoc.getLength(); i++) {
                   messageText.setCaretPosition(i);
                   if (StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && !bold) {
                        bold = true;
                        if (text != null) {
                             text = text + "<b>";
                        else {
                             text = "<b>";
                   else if (StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && bold) {
                        // Do nothing
                   else if (!StyleConstants.isBold(messageDoc.getCharacterElement(i).getAttributes()) && bold) {
                        bold = false;
                        if (text != null) {
                             text = text + "</b>";
                        else {
                             text = "</b>";
                   try {
                        if (text != null) {
                             text = text + messageDoc.getText(i,1);
                        else {
                             text = messageDoc.getText(i, 1);
                   catch (BadLocationException e) {
                        System.out.println("An error occurred while getting the text from the message document");
                        e.printStackTrace();
              return text;
         } // end getMessageText()When the message is sent to the other client, the program searches through the received message and changes the text between the bold tags to bold. This seems as if it should work, but as soon as I click on the bold button, I get a StateInvariantError. The code for my button is:
    public void actionPerformed(ActionEvent evt) {
              if (evt.getSource() == bold) {
                   MutableAttributeSet bold = new SimpleAttributeSet();
                   StyleConstants.setBold(bold, true);
                   messageText.getStyledDocument().setCharacterAttributes(messageText.getSelectionStart(), messageText.getSelectionStart() - messageText.getSelectionEnd() - 1, bold, false);
         } //end actionPerformed()Can anyone help me to figure out why this error is being thrown? I have searched for a while to figure out this way of doing what I'm trying to do and I've found out that a StateInvariantError has been reported as a bug in several different circumstances but not in relation to this. Or, if there is a better way to add and check the style of the text that would be great as well. Any help is much appreciated, thanks in advance.

    Swing related questions should be posted in the Swing forum.
    Can't tell from you code what the problem is because I don't know the context of how each method is invoked. But it would seem like you are trying to query the data in the Document while the Document is being updated. Try wrapping the getMessageText() method is a SwingUtilities.invokeLater().
    There is no need to write custom code for a Bold Action you can just use:
    JButton bold = new JButton( new StyledEditorKit.BoldAction() );Also your code to build the text String is not very efficient. You should not be using string concatenation to append text to the string. You should be using a StringBuffer or StringBuilder.

  • Vertical Text in PDF using CFDOCUMENT

    I am using font tag in a CSS file to layout a table header
    using vertical text. In HTML, the vertical text looks fine.
    However, when I convert the table to a pdf using
    <cfdocument>, the vertical text is displayed as horizintal
    text and does not follow the css specified font family, color or
    size.
    Here is the line in the CCS I am referencing:
    .header_vertical {FONT-WEIGHT: bold; FONT-SIZE: 8pt;
    FONT-STYLE: normal; writing-mode:tb-rl; FONT-FAMILY: helvetica,
    arial, verdana, sans-serif; TEXT-DECORATION: none; COLOR: #0f437c}
    This is CFMX7 on a Windows Server 2003 OS running IIS.
    Any ideas???
    Thanks.

    Hi there, did you find a solution to this?
    I had the same issue and no matter what i tried it didn't
    work. I found out that CFDOCUMENT doesn't support CSS2.
    Eventually I came up with a clunky solution, but had no other
    choice. I bought some imaging software called Alagad (
    http://www.alagad.com) which
    produces the vertical text as images on the fly. Its not ideal, but
    there was no ther way I could disply the text.
    Hope this helps you.
    Ally

  • Creating Vertical text in horizontal position ... ??

    Hi
    I am tring to print text onto address labels in a vertical orientaion (for final use). I have a large CD collection and I am trying to print headings for plastic cards that have a small tab that sticks out. I found small address labels to be the perfect size to stick on. However, I will be appling the labels vertically.
    Pages allows you to take horizontal text and rotate it, BUT the letters are NOT stacked on top of each other, you just end up with diagnol or sideways rotated text.
    WordArt in MS Word allows you to orient the text the way I want, but I was hoping for an easier solution in Pages - as the resizing in wordart is cumbersome and fixed to varies intervalls, you cannot enter specific number sizes.
    I hope I was decribing this clearly.
    Thanks AL

    You can achieve the effect you want by creating a text box (it should be set for Moves With Text and Wrap should be off). Type your text with a return after each letter and then narrow the box to fit the vertical text. Next, in the Text Inspector center the text. Go to the Metrics inspector and type "90" in the Angle box at the bottom.
    You should be able to copy and paste this to your template.
    Walt

  • Vertical text direction / orientation in tables. (RoboHelp 7 and/or 8)

    Hello all,
    I need to squeeze a fairly full table (lots of columns) into a printable page width.
    In order to do this, I need to put text into some of the cells so that they read vertically. I can do this in MS Word tables (menu > Format > Text Direction) and need an equivalent in RH. Preferably RH7, (but can import into RH8 if I must ).
    Any ideas anyone?

    Hi Philip
    My guess is that you can probably fudge it using CSS. But it won't be something RoboHelp will assist with in any way.
    Check the link below for one hit I found. Use Google searching for vertical text in HTML to find others.
    Click here to view
    Cheers... Rick
    Helpful and Handy Links
    RoboHelp Wish Form/Bug Reporting Form
    Begin learning RoboHelp HTML 7 or 8 moments from now - $24.95!
    Adobe Certified RoboHelp HTML Training
    SorcererStone Blog
    RoboHelp eBooks

  • Vertical text in CR 2008

    Hello,
    I need to display the text in the columns labels vertically. When I set text rotation to 90 degrees, the text is rotated in the designer, but when I run the report - it's horizontal. However, when I print or export the report, the text is vertical again.
    After searching Google I've found out that this is a known bug in CR. However, I didn't find any solution other than using a CSS file. I've never used CSS with the Crystal Reports, so I wonder - is there any other solution to this problem? I need the text to be vertical on the web site as well.
    Thank you.

    The following information may help you
    Symptom
    Crystal Reports XI using vertical text is displayed correctly in Crystal reports designer.
    When exported reports are viewed in web appplication like Infoview, the report text is displayed horizontally.
    Reproducing the Issue
    Text rotated by 90 Degrees to vertical, changes back to horizontal.
    Environment:
    Crystal Reports XI
    Cause
    Crystal reports does not display the text as required,in normal view.
    Resolution
    1) Login to Infoview
    2) Click on preferences icon on the upper-right corner.
    3) Click on Crystal reports
    4) Select Active X Viewer
    5) Click Ok
    Keywords
    Vertical text, Horizontal text, Crystal Reports,Active X viewer
    Regards,
    Raghavendra

  • Vertical text in charts appears upside-down in Acrobat pdf

    When I copy a chart with vertical text from Tableau into Word and then Save as Adobe PDF, the vertical text appears upside-down.
    When I copy a chart with vertical text from Tableau into Word and then Save as PDF using Word's built in PDF creator, the vertical text appears correctly.
    This bug occurs in both Adobe Acrobat 11 and Acrobat Pro DC. Can Adobe fix this bug?

    Never mind. I solved the problem myself. It turns out I needed to embed the font I used in the text boxes. Once I did that, everything shows up fine.

  • Vertical Text in PowerPoint saved as a PDF

    I just created a document in PowerPoint with vertical text.  When I saved the document, some of the vertical text and rotated back to horizontal changing the format of my document. Is there a way to save a PowerPoint document as PDF without changing the vertical text.

    I think you really need to ask that in a Microsoft Office forum.

  • Vertical text in JTabbedPanes on MAC

    Hi all,
    I use the CrossPlatformLookAndFeel for my Java application and I want to have vertical text in tabs with are placed on the left side. For displaying the vertical text I use a special TabbedPanUI (see code below) which rotates the text. This works fine on Linux and Windows platforms, but on Mac the text is not readable.
    Anyone got a clue about this??
    Thank for your help
    import java.awt.AlphaComposite;
    import java.awt.Color;
    import java.awt.Font;
    import java.awt.FontMetrics;
    import java.awt.Graphics;
    import java.awt.Graphics2D;
    import java.awt.Image;
    import java.awt.Insets;
    import java.awt.Rectangle;
    import java.awt.image.BufferedImage;
    import javax.swing.Icon;
    import javax.swing.ImageIcon;
    import javax.swing.JTabbedPane;
    import javax.swing.UIManager;
    import javax.swing.plaf.basic.BasicGraphicsUtils;
    import javax.swing.plaf.basic.BasicTabbedPaneUI;
    * @author elkes
    public class DOOCSTabbedPaneUI extends BasicTabbedPaneUI {
        /** Creates a new instance of DOOCSTabbedPaneUI */
        public DOOCSTabbedPaneUI() {
            super();
        private Image getVerticalImage(int tabIndex) {
            ImageIcon iconNormale = (ImageIcon) tabPane.getIconAt(tabIndex);
            int iconWidth = (iconNormale != null) ? iconNormale.getIconHeight() : 0;
            int iconHeight = (iconNormale != null) ? iconNormale.getIconWidth() : 0;
            String title = tabPane.getTitleAt(tabIndex);
            FontMetrics metrics = getFontMetrics();
            int titleWidth = (title != null) ? metrics.stringWidth(title) : 0;
            int titleHeight = (title != null) ? metrics.getHeight() : 0;
            int height = iconWidth + titleWidth + textIconGap + 1;
            int width = Math.max(iconHeight, titleHeight);
            if (width==0) width=1;
            boolean isSelected = (tabPane.getSelectedIndex() == tabIndex);
            int tabPlacement = tabPane.getTabPlacement();
            BufferedImage image = new BufferedImage(width, height, BufferedImage.TYPE_INT_ARGB);
            Graphics2D g2 = image.createGraphics();
            g2.setComposite(AlphaComposite.Src);
            if (tabPlacement == JTabbedPane.LEFT) {
                g2.translate(0, height);
                g2.rotate(-Math.PI / 2);
            } else {
                g2.translate(width, 0);
                g2.rotate(Math.PI / 2);
            Color background = (isSelected) ? UIManager.getColor("TabbedPane.selected")
                    : tabPane.getBackgroundAt(tabIndex);
            g2.setColor(background);
            g2.fillRect(0, 0, height, width);
            if (iconNormale != null) {
                g2.drawImage(iconNormale.getImage(), 0, 0, null);
            if (title != null) {
                g2.setFont(metrics.getFont());
                g2.setColor(tabPane.getForegroundAt(tabIndex));
                int mnemIndex = tabPane.getDisplayedMnemonicIndexAt(tabIndex);
                BasicGraphicsUtils.drawStringUnderlineCharAt(g2, title, mnemIndex, iconWidth + textIconGap, metrics.getAscent());
            g2.dispose();
            return image;
        private boolean isBottomOrTop() {
            int tabPlacement = tabPane.getTabPlacement();
            return tabPlacement == JTabbedPane.TOP || tabPlacement == JTabbedPane.BOTTOM;
        protected int calculateTabHeight(int tabPlacement, int tabIndex, int fontHeight) {
            if (isBottomOrTop()) {
                return super.calculateTabHeight(tabPlacement, tabIndex, fontHeight);
            return super.calculateTabWidth(tabPlacement, tabIndex, getFontMetrics());
        protected int calculateTabWidth(int tabPlacement, int tabIndex, FontMetrics metrics) {
            if (isBottomOrTop()) {
                return super.calculateTabWidth(tabPlacement, tabIndex, metrics);
            return getVerticalImage(tabIndex).getWidth(null);
        protected void paintText(Graphics g, int tabPlacement, Font font, FontMetrics metrics, int tabIndex, String title, Rectangle textRect, boolean isSelected) {
            if (isBottomOrTop()) {
                super.paintText(g, tabPlacement, font, metrics, tabIndex, title, textRect, isSelected);
            } else {
                Image image = getVerticalImage(tabIndex);
                Rectangle r = getTabBounds(tabPane, tabIndex);
                Insets insets = getTabAreaInsets(tabPlacement);
                int dx = r.x + insets.top;
                int dy = r.y;
                if (tabPlacement == JTabbedPane.LEFT) {
                    dy += insets.left;
                } else {
                    dy += insets.right;
                g.drawImage(image, dx, dy, null);
        protected void paintIcon(Graphics g, int tabPlacement, int tabIndex,
                Icon icon, Rectangle iconRect, boolean isSelected) {
            if (!isBottomOrTop()) {
                return;
            super.paintIcon(g, tabPlacement, tabIndex, icon, iconRect, isSelected);
    }

    Maybe the approach of using a [url http://tips4java.wordpress.com/2009/04/06/rotated-icon/]Rotated Icon along with the TextIcon, will work on all platforms without using a custom UI.

  • Vertical Text in Firefox

    Is there a way to display vertical text in Firefox? I can do
    it with CSS3 in IE, but not in FF.
    Is there a way to generate a dynamic image containing the
    text, and then reference it with <img
    src=vertText.cfm?text=myText...
    I know this can be done in PHP, but how would one approach
    this problem in ColdFusion?
    Any help would be highly appreciated.

    with CF8 you could create a cfc which would accept text as an
    argument
    and using cf's new image manipulation tags and functions
    create the
    image on the fly for you and output it to the browser
    with prior cf versions it is probably still possible, but
    trickier since
    there are no built-in image manupulation so one has to use
    3rd party
    image tools...
    Azadi Saryev
    Sabai-dee.com
    http://www.sabai-dee.com

  • Vertical text in Sapcript

    How can I put a variable vertical text in Sapscript?

    Made some tests by myself, and it works pretty well...
    I will to put the sample thinking in number, but you can make it more general changing some things (like the IF ELSEIF clauses, and of course, the bitmaps to upload)
    1) Make (or seek for) bitmaps with numbers rotated 90º (let's suppose you use bitmaps named bmpzero, bmpone... and monochrome)
    2) Put in your form n new windows (where n means the lenght your number must have)
    3) Put in each of your windows the next statements (changing the DECLARE statement in function of the position of each figure in your number:
    you must have declared mynumber in the report where you call the form, or you must change the sentence below :P
    /: DECLARE &myfigure& = &mynumber+n(1)& <-- n is the position of your figure
    /: CASE &myfigure&.
    /: WHEN '0'.
    /: BITMAP bmpzero OBJECT GRAPHICS ID BMAP TYPE BMON.
    /: WHEN '1'.
    /: BITMAP bmpone OBJECT GRAPHICS ID BMAP TYPE BMON.
    /: ENDCASE.
    I wish be useful for you this piece of code. Regards,
    Vicenç

Maybe you are looking for

  • Airport Extreme b/g as dedicated print network?

    I have used an older AirPort Extreme b/g for some years now to print via USB with an ancient HP LaserJet 4ML printer. Thanks to iFelix's web site, I learned how to set up the USB printing using the HP Jet Direct-Socket setting in the Printer Setup Ut

  • BW upgrade 3.0 to 3.5

    HI all, we are about to upgrade a BW project from 3.0 to 3.5. could any one explain me the upgrade procedue. and pl mail me if u have any extact procedure documents and live issues. Thanks in advance. kiran [email protected]

  • Orinoco silver wireless driver in Solaris 10

    Hi Does Solaris 10 support orinoco silver wireless cards ? I have one with a pcmcia PCI bridge adapter. I can try to use it with solaris ? Thanks in advance roberto

  • Safari 5.1.10 with the OS X 10.6.8 to the new Mavericks OS upgrade.

    I have Safari 5.1.10 with the OS 10.6.8, and I want to upgrade to the new MAvericks OS. I want to know if my Reading List and Bookmarks will get erased with the upgrade. Thanks

  • Classic Printer Sharing

    Ugh! I'm helping some friends get up and running with Printer Sharing. I know this feature works great in OSX, but they have one OSX box and one box in Classic. Both computers can see each other and share drives, but if the printer is connected to OS