Align & Justify Text

Is there a way to do this in the Lync 2013 client?

If you want to center and justify text, I am afraid there is no such way to do this.
Please remember to click “Mark as Answer” on the post that helps you, and to click “Unmark as Answer” if a marked post does not actually answer your question. This can be beneficial to other community members reading the thread.

Similar Messages

  • Hyphenation & text-align:justify in PDF's with CFDOCUMENT

    Hello everybody!
    We are using CF8.1 and are having problems of generating well designed PDF outputs with CFDOCUMENT. We would like to print out reports, which are hyphenated and have the text aligned. Example:
    This works fine:
    <html lang="en">
    <STYLE>p { width:260px;background-color:blue;-moz-hyphens: auto; -o-hyphens: auto; -webkit-hyphens: auto; -ms-hyphens: auto;  -hyphens: auto;text-align:justify}</STYLE>
    <P>Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer</P>
    </html>
    This won't:
    <CFDOCUMENT FORMAT="PDF">
    <html lang="en">
          <STYLE>p { width:260px;background-color:blue;-moz-hyphens: auto; -o-hyphens: auto; -webkit-hyphens: auto; -ms-hyphens: auto;  -hyphens: auto;text-align:justify}</STYLE>
          <P>Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer Haematodynamometer</P>
    </html>
    </CFDOCUMENT>
    Do you have any solutions on this topics? Are do I have to wait until CF11.
    Thanks in advance
    Matthias

    4tun8mom wrote:
    Now, the problem is that, while the client likes this, they don't like that the headers and footers are grayed out and the colors are not as vibrant in Word as the program part I created and saved as a PDF.
    They're being a bit impractical in their complaints, in fact they remind me of my Dad!  The final product is still fine.
    4tun8mom wrote:
    They also don't like that if we keep this as a Word document, all the text is editable.
    That's fair enough, the solution would be to make the text in the header and footer an image instead.
    4tun8mom wrote:
    So my question is, can I create a PDF that has the same features with the expandable text control boxes.  If I can, would you recommend InDesign to do this?
    No you can't.  I'm pretty sure you can't create a PDF with expandable boxes and I'm very sure that you can't create a PDF that will add pages with headers and footrs.  However you can create a PDF with basic fillable text boxes, they're called forms and you need Acrobat as well to do it, google it and you'll find plenty of info.

  • How to align the text in justify format with SQL Server Reporting Services?

            How to align the text in justify format In SQL server Reporting Services? Is there any code to do so?

    Hi,
    I'm afraid that if you want to have this kind of functionality, you will need to write a custom control. Here is an example: http://msdn2.microsoft.com/en-us/library/ms345265.aspx. The issue with custom controls is that it needs to be known by all the reportservers that will render your report.
    Greetz,
    Geert
    Geert Verhoeven
    Consultant @ Ausy Belgium
    My Personal Blog

  • Content Alignment = Justify In text Box

    Dear Friend,
    i have text Area Item for description .Here i want content alignment justify in that Text Area.
    How can i alighnment in Text Box.
    Thanks
    Edited by: Vedant on Sep 16, 2011 4:32 AM

    Hello,
    if by text box you mean a standard textarea item then i'm afraid you can't do that.
    It might be possibel if you use a rich text editor item.
    Regards,
    Dirk

  • Justify text still doesn't work correctly in Pages 2.0.1

    Justify text does not work in Pages 2 or 2.0.1 when one wishes to specify where the lines should break. It used to work in Pages 1 by using <SHIFT-RETURN>. Does anyone know a workaround?
    Thanks.

    Hello John,
    this is because of the "sero point" where the calculation between the "text paragraph align" settings and the ruler differ. In "left aligned" and "justified" the calculation begins from the left, similar to the ruler, so all works fine. But in "centered" and "right aligned" the calculation begins from the center or from the right, but the ruler calculation is in both cases from left to right.
    This is a limitation of the overall system. To get this right, the ruler has to change it's calculation direction by setting "centered" and "right aligned", too. But you continue writing from left to right, so what about the inversion of the "left" and "right aligned" tab stops?
    I don't know if you have done this, but you can send a feedback to the developer with some suggestions about this: http://www.apple.com/feedback/pages.html

  • How to justify text in a TextInput vertically

    So I have a simple question: how can you justify text in a TextInput vertically?

    Yeah, sorry, I should have given more details. Basically I have a TextInput component with a height of 48 so even though it is a one line component it looks like there is a lot of space below the text. The component in question is created dynamically during run-time. So I was tasked with making the text appear in the middle (vertically) of the TextInput. Is this not possible at all? Surely there is some way to do it.
    Here is the Actionscript code that creates the components:
    import fl.controls.TextInput;
    import flash.text.TextFormatAlign;
    var gridArr:Array = new Array();
    var w = 80;
    var h = 48;
    var rowNumber = 10;
    var startX = 5;
    var startY = 30;
    var newTextFormat:TextFormat = new TextFormat();
    newTextFormat.font = "Arial";
    newTextFormat.size = 16;
    newTextFormat.bold = true
    newTextFormat.color = 0x1E1E1E;
    newTextFormat.align = TextFormatAlign.JUSTIFY;
    newTextFormat.leading = 5;
    for (var i:Number = 0; i < 8; i++)
      gridArr[i] = new Array();
      for (var j:Number = 0; j < rowNumber; j++)
       var newCell:Cell =  new Cell();
       newCell.initialize(i, j);
       newCell.cellText.setStyle("textFormat", newTextFormat);
       newCell.cellText.width = w;
       newCell.cellText.height = h;
       newCell.x = (i*w) + startX;
       newCell.y = (j*h) + startY;
       //newCell.cellText.text = "("+newCell.gridX+","+newCell.gridY+")";
       //newCell.cellText.tabEnabled = false;
       gridArr[i][j] = newCell;
    for (j = 0; j < rowNumber; j++)
    for (i= 0; i < 8; i++)
      addChild(gridArr[i][j]);

  • Justify text in Acrobat X

    I just switched over to Acrobat X. I am having trouble finding the spot to justify the text inside of a text box. Help!

    Are you asking about a text form field or a text box comment? If a form field, it has to be set up to allow rich text formatting. You can then bring up the Properties toolbar (Ctrl+E) and select the Align Justify button. This will work for text box comments as well.

  • Align JUSTIFIED, firstLineIdent, lineSpacing solution

    Align Justified, First line ident, line spacing features don't work correct.
    So i can suggest solution for these things.
    I implemented my ParagraphView class for this purpose.
    Hope it helps for somebody.
    best regards
    Stas
    This is the source code of example.
    import java.awt.*;
    import java.awt.event.*;
    import javax.swing.*;
    import javax.swing.text.*;
    import java.util.*;
    * Represents extension for Paragraph view.
    * @author     Stanislav Lapitsky
    class Main {
    JEditorPane pane;
    int ALIGNMENT=StyleConstants.ALIGN_JUSTIFIED;
    float LINE_SPACING=2;
    float FIRST_LINE_IDENT=50;
    public Main() {
    JFrame mainFrame=new JFrame("Advanced paragraph features support...");
    mainFrame.setDefaultCloseOperation(JFrame.EXIT_ON_CLOSE);
    pane=new JEditorPane();
    pane.setEditorKit(new StyledEditorKit_());
    JScrollPane sp=new JScrollPane(pane);
    mainFrame.getContentPane().setLayout(new BorderLayout());
    mainFrame.getContentPane().add(sp,BorderLayout.CENTER);
    StyledDocument doc=(StyledDocument)pane.getDocument();
    try {
    doc.insertString(0,"Advanced paragraph view implements following features: First line ident support, line spacing support, alignment justified support. Implemented by Stanislav Lapitsky. ",null);
    catch (Exception ex) {
    MutableAttributeSet attr=new SimpleAttributeSet();
    StyleConstants.setFirstLineIndent(attr,FIRST_LINE_IDENT);
    StyleConstants.setLineSpacing(attr,LINE_SPACING);
    StyleConstants.setAlignment(attr,ALIGNMENT);
    doc.setParagraphAttributes(0,doc.getLength()-1,attr,false);
    mainFrame.setBounds(100,100,330,200);
    mainFrame.show();
    public static void main(String[] args) {
    new Main();
    class StyledEditorKit_ extends StyledEditorKit {
    public ViewFactory getViewFactory() {
    return new StyledViewFactory_();
    class StyledViewFactory_ implements ViewFactory {
    public View create(Element elem) {
    String kind = elem.getName();
    if (kind != null) {
    if (kind.equals(AbstractDocument.ContentElementName)) {
    return new LabelView(elem);
    } else if (kind.equals(AbstractDocument.ParagraphElementName)) {
    // return new ParagraphView(elem);
    return new AdvancedParagraphView(elem);
    } else if (kind.equals(AbstractDocument.SectionElementName)) {
    return new BoxView(elem, View.Y_AXIS);
    } else if (kind.equals(StyleConstants.ComponentElementName)) {
    return new ComponentView(elem);
    } else if (kind.equals(StyleConstants.IconElementName)) {
    return new IconView(elem);
    // default to text display
    return new LabelView(elem);
    * Represents extension for Paragraph view.
    * @author     Stanislav Lapitsky
    class AdvancedParagraphView extends ParagraphView {
    public AdvancedParagraphView(Element elem) {
    super(elem);
    strategy=new AdvancedFlowStrategy();
    protected View createRow() {
    Element elem = getElement();
    return new AdvancedRow(elem);
    protected static int getSpaceCount(String content) {
    int result=0;
    int index=content.indexOf(' ');
    while (index>=0) {
    result++;
    index=content.indexOf(' ',index+1);
    return result;
    protected static int[] getSpaceIndexes(String content,int shift) {
    int cnt=getSpaceCount(content);
    int[] result=new int[cnt];
    int counter=0;
    int index=content.indexOf(' ');
    while (index>=0) {
    result[counter]=index+shift;
    counter++;
    index=content.indexOf(' ',index+1);
    return result;
    public static class AdvancedFlowStrategy extends FlowStrategy {
    public void layout(FlowView fv) {
    super.layout(fv);
    AttributeSet attr=fv.getElement().getAttributes();
    float lineSpacing=StyleConstants.getLineSpacing(attr);
    boolean justifiedAlignment=(StyleConstants.getAlignment(attr)==StyleConstants.ALIGN_JUSTIFIED);
    if (!(justifiedAlignment || (lineSpacing > 1)) ){
    return;
    int cnt=fv.getViewCount();
    for (int i=0; i<cnt-1; i++) {
    AdvancedRow row=(AdvancedRow)fv.getView(i);
    if(lineSpacing > 1) {
    float height = row.getMinimumSpan(View.Y_AXIS);
    float addition = (height * lineSpacing) - height;
    if(addition > 0) {
    row.setInsets(row.getTopInset(), row.getLeftInset(),
    (short) addition, row.getRightInset());
    if (justifiedAlignment) {
    restructureRow(row,i);
    row.setRowNumber(i+1);
    protected void restructureRow(View row,int rowNum) {
    int rowStartOffset=row.getStartOffset();
    int rowEndOffset=row.getEndOffset();
    String rowContent="";
    try {
    rowContent=row.getDocument().getText(rowStartOffset,rowEndOffset-rowStartOffset);
    if (rowNum==0) {
    int index=0;
    while (rowContent.charAt(0)==' ') {
    rowContent=rowContent.substring(1);
    if (rowContent.length()==0)
    break;
    catch (Exception e) {
    e.printStackTrace();
    int rowSpaceCount=getSpaceCount(rowContent);
    if (rowSpaceCount<1)
    return;
    int[] rowSpaceIndexes=getSpaceIndexes(rowContent,row.getStartOffset());
    int currentSpaceIndex=0;
    for (int i=0; i<row.getViewCount(); i++) {
    View child=row.getView(i);
    if ((child.getStartOffset()<rowSpaceIndexes[currentSpaceIndex]) &&
    (child.getEndOffset()>rowSpaceIndexes[currentSpaceIndex])) {
    //split view
    View first=child.createFragment(child.getStartOffset(),rowSpaceIndexes[currentSpaceIndex]);
    View second=child.createFragment(rowSpaceIndexes[currentSpaceIndex],child.getEndOffset());
    View[] repl=new View[2];
    repl[0]=first;
    repl[1]=second;
    row.replace(i,1,repl);
    currentSpaceIndex++;
    if (currentSpaceIndex>=rowSpaceIndexes.length)
    break;
    int childCnt=row.getViewCount();
    class AdvancedRow extends BoxView {
    private int rowNumber=0;
    AdvancedRow(Element elem) {
    super(elem, View.X_AXIS);
    protected void loadChildren(ViewFactory f) {
    public AttributeSet getAttributes() {
    View p = getParent();
    return (p != null) ? p.getAttributes() : null;
    public float getAlignment(int axis) {
    if (axis == View.X_AXIS) {
    AttributeSet attr=getAttributes();
    int justification=StyleConstants.getAlignment(attr);
    switch (justification) {
    case StyleConstants.ALIGN_LEFT:
    case StyleConstants.ALIGN_JUSTIFIED:
    return 0;
    case StyleConstants.ALIGN_RIGHT:
    return 1;
    case StyleConstants.ALIGN_CENTER:
    return 0.5f;
    return super.getAlignment(axis);
    public Shape modelToView(int pos, Shape a, Position.Bias b) throws BadLocationException {
    Rectangle r = a.getBounds();
    View v = getViewAtPosition(pos, r);
    if ((v != null) && (!v.getElement().isLeaf())) {
    // Don't adjust the height if the view represents a branch.
    return super.modelToView(pos, a, b);
    r = a.getBounds();
    int height = r.height;
    int y = r.y;
    Shape loc = super.modelToView(pos, a, b);
    r = loc.getBounds();
    r.height = height;
    r.y = y;
    return r;
    public int getStartOffset() {
    int offs = Integer.MAX_VALUE;
    int n = getViewCount();
    for (int i = 0; i < n; i++) {
    View v = getView(i);
    offs = Math.min(offs, v.getStartOffset());
    return offs;
    public int getEndOffset() {
    int offs = 0;
    int n = getViewCount();
    for (int i = 0; i < n; i++) {
    View v = getView(i);
    offs = Math.max(offs, v.getEndOffset());
    return offs;
    protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
    baselineLayout(targetSpan, axis, offsets, spans);
    protected SizeRequirements calculateMinorAxisRequirements(int axis, SizeRequirements r) {
    return baselineRequirements(axis, r);
    protected int getViewIndexAtPosition(int pos) {
    // This is expensive, but are views are not necessarily layed
    // out in model order.
    if(pos < getStartOffset() || pos >= getEndOffset())
    return -1;
    for(int counter = getViewCount() - 1; counter >= 0; counter--) {
    View v = getView(counter);
    if(pos >= v.getStartOffset() &&
    pos < v.getEndOffset()) {
    return counter;
    return -1;
    public short getTopInset() {
    return super.getTopInset();
    public short getLeftInset() {
    return super.getLeftInset();
    public short getRightInset() {
    return super.getRightInset();
    public void setInsets(short topInset,short leftInset, short bottomInset, short rightInset) {
    super.setInsets(topInset,leftInset,bottomInset,rightInset);
    protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
    super.layoutMajorAxis(targetSpan,axis,offsets,spans);
    AttributeSet attr=getAttributes();
    if ((StyleConstants.getAlignment(attr)!=StyleConstants.ALIGN_JUSTIFIED) && (axis!=View.X_AXIS)){
    return;
    int cnt=offsets.length;
    int span=0;
    for (int i=0; i<cnt; i++) {
    span+=spans;
    if (getRowNumber()==0)
    return;
    int startOffset=getStartOffset();
    int len=getEndOffset()-startOffset;
    String context="";
    try {
    context=getElement().getDocument().getText(startOffset,len);
    catch (Exception e) {
    e.printStackTrace();
    int spaceCount=getSpaceCount(context)-1;
    int pixelsToAdd=targetSpan-span;
    if (this.getRowNumber()==1) {
    int firstLineIndent=(int)StyleConstants.getFirstLineIndent(getAttributes());
    pixelsToAdd-=firstLineIndent;
    int[] spaces=getSpaces(pixelsToAdd,spaceCount);
    int j=0;
    int shift=0;
    for (int i=1; i<cnt; i++) {
    LabelView v=(LabelView)getView(i);
    offsets[i]+=shift;
    if ((isContainSpace(v)) && (i!=cnt-1)) {
    offsets[i]+=spaces[j];
    spans[i-1]+=spaces[j];
    shift+=spaces[j];
    j++;
    protected int[] getSpaces(int space,int cnt) {
    int[] result=new int[cnt];
    if (cnt==0)
    return result;
    int base=space/cnt;
    int rst=space % cnt;
    for (int i=0; i<cnt; i++) {
    result[i]=base;
    if (rst>0) {
    result[i]++;
    rst--;
    return result;
    public float getMinimumSpan(int axis) {
    if (axis==View.X_AXIS) {
    AttributeSet attr=getAttributes();
    if (StyleConstants.getAlignment(attr)!=StyleConstants.ALIGN_JUSTIFIED) {
    return super.getMinimumSpan(axis);
    else {
    return this.getParent().getMinimumSpan(axis);
    else {
    return super.getMinimumSpan(axis);
    public float getMaximumSpan(int axis) {
    if (axis==View.X_AXIS) {
    AttributeSet attr=getAttributes();
    if (StyleConstants.getAlignment(attr)!=StyleConstants.ALIGN_JUSTIFIED) {
    return super.getMaximumSpan(axis);
    else {
    return this.getParent().getMaximumSpan(axis);
    else {
    return super.getMaximumSpan(axis);
    public float getPreferredSpan(int axis) {
    if (axis==View.X_AXIS) {
    AttributeSet attr=getAttributes();
    if (StyleConstants.getAlignment(attr)!=StyleConstants.ALIGN_JUSTIFIED) {
    return super.getPreferredSpan(axis);
    else {
    return this.getParent().getPreferredSpan(axis);
    else {
    return super.getPreferredSpan(axis);
    public void setRowNumber(int value) {
    rowNumber=value;
    public int getRowNumber() {
    return rowNumber;
    public int getFlowSpan(int index) {
    int span=super.getFlowSpan(index);
    if (index==0) {
    int firstLineIdent=(int)StyleConstants.getFirstLineIndent(this.getAttributes());
    span-=firstLineIdent;
    return span;
    protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets, int[] spans) {
    super.layoutMinorAxis(targetSpan, axis, offsets, spans);
    int firstLineIdent=(int)StyleConstants.getFirstLineIndent(this.getAttributes());
    offsets[0]+=firstLineIdent;
    protected static boolean isContainSpace(View v) {
    int startOffset=v.getStartOffset();
    int len=v.getEndOffset()-startOffset;
    try {
    String text=v.getDocument().getText(startOffset,len);
    if (text.indexOf(' ')>=0)
    return true;
    else
    return false;
    catch (Exception ex) {
    return false;

    I've managed to interpret what was in the POST and so just to help out here's how to get it all working:
    In a file called AdvancedParagraphView.java
    package .....<your package>.....
    import javax.swing.text.*;
    import java.awt.*;
    import javax.swing.*;
    public class AdvancedParagraphView extends ParagraphView {
      public AdvancedParagraphView(Element elem) {
        super(elem);
        strategy = new AdvancedFlowStrategy();
      protected View createRow() {
        Element elem = getElement();
        return new AdvancedRow(elem);
      protected static int getSpaceCount(String content) {
        int result = 0;
        int index = content.indexOf(' ');
        while (index >= 0) {
          result++;
          index = content.indexOf(' ', index + 1);
        return result;
      protected static int[] getSpaceIndexes(String content, int shift) {
        int cnt = getSpaceCount(content);
        int[] result = new int[cnt];
        int counter = 0;
        int index = content.indexOf(' ');
        while (index >= 0) {
          result[counter] = index + shift;
          counter++;
          index = content.indexOf(' ', index + 1);
        return result;
      static class AdvancedFlowStrategy
          extends FlowStrategy {
        public void layout(FlowView fv) {
          super.layout(fv);
          AttributeSet attr = fv.getElement().getAttributes();
          float lineSpacing = StyleConstants.getLineSpacing(attr);
          boolean justifiedAlignment = (StyleConstants.getAlignment(attr) ==
                                        StyleConstants.ALIGN_JUSTIFIED);
          if (! (justifiedAlignment || (lineSpacing > 1))) {
            return;
          int cnt = fv.getViewCount();
          for (int i = 0; i < cnt - 1; i++) {
            AdvancedRow row = (AdvancedRow) fv.getView(i);
            if (lineSpacing > 1) {
              float height = row.getMinimumSpan(View.Y_AXIS);
              float addition = (height * lineSpacing) - height;
              if (addition > 0) {
                row.setInsets(row.getTopInset(), row.getLeftInset(),
                              (short) addition, row.getRightInset());
            if (justifiedAlignment) {
              restructureRow(row, i);
              row.setRowNumber(i + 1);
        protected void restructureRow(View row, int rowNum) {
          int rowStartOffset = row.getStartOffset();
          int rowEndOffset = row.getEndOffset();
          String rowContent = "";
          try {
            rowContent = row.getDocument().getText(rowStartOffset,
                                                   rowEndOffset - rowStartOffset);
            if (rowNum == 0) {
              int index = 0;
              while (rowContent.charAt(0) == ' ') {
                rowContent = rowContent.substring(1);
                if (rowContent.length() == 0)
                  break;
          catch (Exception e) {
            e.printStackTrace();
          int rowSpaceCount = getSpaceCount(rowContent);
          if (rowSpaceCount < 1)
            return;
          int[] rowSpaceIndexes = getSpaceIndexes(rowContent, row.getStartOffset());
          int currentSpaceIndex = 0;
          for (int i = 0; i < row.getViewCount(); i++) {
            View child = row.getView(i);
            if ( (child.getStartOffset() < rowSpaceIndexes[currentSpaceIndex]) &&
                (child.getEndOffset() > rowSpaceIndexes[currentSpaceIndex])) {
    //split view
              View first = child.createFragment(child.getStartOffset(),
                                                rowSpaceIndexes[currentSpaceIndex]);
              View second = child.createFragment(rowSpaceIndexes[currentSpaceIndex],
                                                 child.getEndOffset());
              View[] repl = new View[2];
              repl[0] = first;
              repl[1] = second;
              row.replace(i, 1, repl);
              currentSpaceIndex++;
              if (currentSpaceIndex >= rowSpaceIndexes.length)
                break;
          int childCnt = row.getViewCount();
      class AdvancedRow
          extends BoxView {
        private int rowNumber = 0;
        AdvancedRow(Element elem) {
          super(elem, View.X_AXIS);
        protected void loadChildren(ViewFactory f) {
        public AttributeSet getAttributes() {
          View p = getParent();
          return (p != null) ? p.getAttributes() : null;
        public float getAlignment(int axis) {
          if (axis == View.X_AXIS) {
            AttributeSet attr = getAttributes();
            int justification = StyleConstants.getAlignment(attr);
            switch (justification) {
              case StyleConstants.ALIGN_LEFT:
              case StyleConstants.ALIGN_JUSTIFIED:
                return 0;
              case StyleConstants.ALIGN_RIGHT:
                return 1;
              case StyleConstants.ALIGN_CENTER:
                return 0.5f;
          return super.getAlignment(axis);
        public Shape modelToView(int pos, Shape a, Position.Bias b) throws
            BadLocationException {
          Rectangle r = a.getBounds();
          View v = getViewAtPosition(pos, r);
          if ( (v != null) && (!v.getElement().isLeaf())) {
    // Don't adjust the height if the view represents a branch.
            return super.modelToView(pos, a, b);
          r = a.getBounds();
          int height = r.height;
          int y = r.y;
          Shape loc = super.modelToView(pos, a, b);
          r = loc.getBounds();
          r.height = height;
          r.y = y;
          return r;
        public int getStartOffset() {
          int offs = Integer.MAX_VALUE;
          int n = getViewCount();
          for (int i = 0; i < n; i++) {
            View v = getView(i);
            offs = Math.min(offs, v.getStartOffset());
          return offs;
        public int getEndOffset() {
          int offs = 0;
          int n = getViewCount();
          for (int i = 0; i < n; i++) {
            View v = getView(i);
            offs = Math.max(offs, v.getEndOffset());
          return offs;
        protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets,
                                       int[] spans) {
          baselineLayout(targetSpan, axis, offsets, spans);
        protected SizeRequirements calculateMinorAxisRequirements(int axis,
            SizeRequirements r) {
          return baselineRequirements(axis, r);
        protected int getViewIndexAtPosition(int pos) {
    // This is expensive, but are views are not necessarily layed
    // out in model order.
          if (pos < getStartOffset() || pos >= getEndOffset())
            return -1;
          for (int counter = getViewCount() - 1; counter >= 0; counter--) {
            View v = getView(counter);
            if (pos >= v.getStartOffset() &&
                pos < v.getEndOffset()) {
              return counter;
          return -1;
        public short getTopInset() {
          return super.getTopInset();
        public short getLeftInset() {
          return super.getLeftInset();
        public short getRightInset() {
          return super.getRightInset();
        public void setInsets(short topInset, short leftInset, short bottomInset,
                              short rightInset) {
          super.setInsets(topInset, leftInset, bottomInset, rightInset);
        protected void layoutMajorAxis(int targetSpan, int axis, int[] offsets,
                                       int[] spans) {
          super.layoutMajorAxis(targetSpan, axis, offsets, spans);
          AttributeSet attr = getAttributes();
          if ( (StyleConstants.getAlignment(attr) != StyleConstants.ALIGN_JUSTIFIED) &&
              (axis != View.X_AXIS)) {
            return;
          int cnt = offsets.length;
          int span = 0;
          for (int i = 0; i < cnt; i++) {
            span += spans;
    if (getRowNumber() == 0)
    return;
    int startOffset = getStartOffset();
    int len = getEndOffset() - startOffset;
    String context = "";
    try {
    context = getElement().getDocument().getText(startOffset, len);
    catch (Exception e) {
    e.printStackTrace();
    int spaceCount = getSpaceCount(context) - 1;
    int pixelsToAdd = targetSpan - span;
    if (this.getRowNumber() == 1) {
    int firstLineIndent = (int) StyleConstants.getFirstLineIndent(
    getAttributes());
    pixelsToAdd -= firstLineIndent;
    int[] spaces = getSpaces(pixelsToAdd, spaceCount);
    int j = 0;
    int shift = 0;
    for (int i = 1; i < cnt; i++) {
    LabelView v = (LabelView) getView(i);
    offsets[i] += shift;
    if ( (isContainSpace(v)) && (i != cnt - 1)) {
    offsets[i] += spaces[j];
    spans[i - 1] += spaces[j];
    shift += spaces[j];
    j++;
    protected int[] getSpaces(int space, int cnt) {
    int[] result = new int[cnt];
    if (cnt == 0)
    return result;
    int base = space / cnt;
    int rst = space % cnt;
    for (int i = 0; i < cnt; i++) {
    result[i] = base;
    if (rst > 0) {
    result[i]++;
    rst--;
    return result;
    public float getMinimumSpan(int axis) {
    if (axis == View.X_AXIS) {
    AttributeSet attr = getAttributes();
    if (StyleConstants.getAlignment(attr) != StyleConstants.ALIGN_JUSTIFIED) {
    return super.getMinimumSpan(axis);
    else {
    return this.getParent().getMinimumSpan(axis);
    else {
    return super.getMinimumSpan(axis);
    public float getMaximumSpan(int axis) {
    if (axis == View.X_AXIS) {
    AttributeSet attr = getAttributes();
    if (StyleConstants.getAlignment(attr) != StyleConstants.ALIGN_JUSTIFIED) {
    return super.getMaximumSpan(axis);
    else {
    return this.getParent().getMaximumSpan(axis);
    else {
    return super.getMaximumSpan(axis);
    public float getPreferredSpan(int axis) {
    if (axis == View.X_AXIS) {
    AttributeSet attr = getAttributes();
    if (StyleConstants.getAlignment(attr) != StyleConstants.ALIGN_JUSTIFIED) {
    return super.getPreferredSpan(axis);
    else {
    return this.getParent().getPreferredSpan(axis);
    else {
    return super.getPreferredSpan(axis);
    public void setRowNumber(int value) {
    rowNumber = value;
    public int getRowNumber() {
    return rowNumber;
    public int getFlowSpan(int index) {
    int span = super.getFlowSpan(index);
    if (index == 0) {
    int firstLineIdent = (int) StyleConstants.getFirstLineIndent(this.
    getAttributes());
    span -= firstLineIdent;
    return span;
    protected void layoutMinorAxis(int targetSpan, int axis, int[] offsets,
    int[] spans) {
    super.layoutMinorAxis(targetSpan, axis, offsets, spans);
    int firstLineIdent = (int) StyleConstants.getFirstLineIndent(this.
    getAttributes());
    offsets[0] += firstLineIdent;
    protected static boolean isContainSpace(View v) {
    int startOffset = v.getStartOffset();
    int len = v.getEndOffset() - startOffset;
    try {
    String text = v.getDocument().getText(startOffset, len);
    if (text.indexOf(' ') >= 0)
    return true;
    else
    return false;
    catch (Exception ex) {
    return false;
    In a file called FixedStyledEditorKit.java
    package .....<your package>.....
    import javax.swing.text.*;
    public class FixedStyledEditorKit extends StyledEditorKit {
      public ViewFactory getViewFactory() {
        return new FixedStyledViewFactory();
    }In a file called FixedStyledViewFactory.java
    package .....<your package>.....
    import javax.swing.text.*;
    public class FixedStyledViewFactory implements ViewFactory {
      public View create(Element elem) {
        String kind = elem.getName();
        if (kind != null) {
          if (kind.equals(AbstractDocument.ContentElementName)) {
            return new LabelView(elem);
          else if (kind.equals(AbstractDocument.ParagraphElementName)) {
    // return new ParagraphView(elem);
            return new AdvancedParagraphView(elem);
          else if (kind.equals(AbstractDocument.SectionElementName)) {
            return new BoxView(elem, View.Y_AXIS);
          else if (kind.equals(StyleConstants.ComponentElementName)) {
            return new ComponentView(elem);
          else if (kind.equals(StyleConstants.IconElementName)) {
            return new IconView(elem);
    // default to text display
        return new LabelView(elem);
    }I then used it with a JTextPane by putting:
    package ....<my package> ....
    JTextPane description = new JTextPane();
        description.setEditorKit(new FixedStyledEditorKit());

  • Verticle alignment of text

    Hi All,
    Is there any way to align the text vertically. At present the data seems to be aligned at the top, i need to align it in centre.
    I Tried Layout->Alignment->Align Centre (Vertically) but it has no effects.
    I also tried SRW.SET_JUSTIFICATION(SRW.JUST_HCENTRE) but it is for horizontal alignment.
    Please Help.
    Regards,
    Ashish Goel

    Hi,
    better u can use center justify. The text has come in to the report automatically center.
    See in the Report Layout model after B, I, U after that four options agiven start justify , center justify , right justify , flush justify
    . which justify u want u can select it .

  • Justify text in field on Adobe PDF form

    How do you justify the text in a form field in Acrobat Pro? The only options I have are left, center and right. I am using version 11 on a Mac. The text box is set to Georgia Italic 10pt, multi-line with rich text formatting. The size of the field is 150mm wide by 85mm deep. Any assistance will be appreciated.

    A user can justify the text in a rich text field, but this is not a property that you can set for a blank field, unfortunately. For the user to do it, they'd have to display the Properties bar (Ctrl+E) and use the Align Justified button:

  • Cfdocument does not support justified text

    I'm finding it impossible to justify text in a PDF created
    using cfdocument. I've tried both <p align="justify"> and CSS
    but
    neither work. If I change it to right or center it works
    which suggests justify is unsupported. Is this a bug or an
    oversight?
    I also tried putting text in P, DIV, SPAN, and tables without
    any luck. I'm using CF 7.01 Ent + hotfix 2 on Win2003. Last time I
    tried to report a bug to Macromedia they insisted I paid $500
    first. Does Adobe have a more professional and fairer policy?
    Is anyone else finding this forum painfully slow? I think
    Adobe should invest in an extra web server or two.
    Thanks,
    Gary.

    Hello Vidyaranya,
    Welcome to the Sony Community.
    I suggest you to contact Sony Reader Support Team here for all the troubleshooting and the information: http://ebooks.custhelp.com/app/answers/detail/a_id/93/kw/contact/r_id/166
    Regards,
    Miguael

  • "Justify" text in Adobe Photoshop Elements 11

    I'm using Adobe Photoshop Elements 11, and I'm trying to add a text box to my picture where the text is aligned to the edge on both the left and right sides.  So it's not left, right, or center aligned, it's what is called "Justify" in Microsoft Word.  There does not seem to be an icon to pick this in Photoshop Elements 11.  Is there a way to do this?
    Thanks,

    R_Kelly,
    I tried this.  You're right, Shift+Ctrl+F works!  I'm almost there.  What I'm actually working on is the design for the back of a book cover.  The thing I noticed is that the last line of a paragraph, which may only have three words, also gets "Justified" so there's huge spaces between the three words as they get stretched across the screen.  I tried inserting a carriage return after that last sentence and it didn't seem to help.  But I did all this after getting home late from work last night, so I need to play with it some more.
    It's odd that there's no pull down menu or icon selection that lets one "Justify" text in pse 11, even when I'm in the "Expert" mode.  Is it that in purchasing pse I bought a watered down version of photoshop.  Because all of the online tutorials I watch on youtube for different versions of photoshop have many more buttons to choose from on the screen.
    What's also odd, though, is that I designed a cover for a book last year, and I somehow got the text to be justified without this last line "spreading" issue.  I also seem to have hyphens at the right edge when the word needs to be hyphenated (again in order to avoid unsightly spacing between words).  I must be getting old, can't remember how I did that.  I did notice that I can duplicate the layer into my new design and the formatting stayed, so I guess I could do that and just type all of the new content.  It's just odd.
    I'm definitely going to spend more time with the Sift+Ctrl+F, because the capability seems to be there, it's just hidden.
    Thank you. 

  • Is there a way to justify text in Photoshop Elements?

    I am trying to justify text in Photoshop Elements 10 but can't find any place that I can do that.  Can I justify text and, if so, how?

    Using a type tool, click the Align pop-up menu and select any of the following:
    Left Align Aligns the left edge of each text line in the layer to the initial cursor position.
    Center
    Aligns the center of each text line in the layer to the initial cursor position.
    Right Align
    Aligns the right edge of each text line in the layer to the initial cursor position.

  • Centre justify text in a JOptionPane

    Hi,
    Does anyone know how I can centre justify text in a JoptionPane?
    Thanking you in advance,
    dude

    Do you mean somehting like this -
                   String messageText = "<html><body align='center'>Please confirm that you do not<br>wish to backup before restoring";
                    String titleText = "Query";
                    int choice = JOptionPane.showConfirmDialog(getDisplayModel().getModalJFrame(),
                            messageText,
                            titleText,
                            JOptionPane.YES_NO_OPTION);

  • Justify text with javasript help

    Hello.
    I'm using Acrobat Pro 10.1.4
    I had to create a text field in which the text is visible on screen but hidden when printing.
    So for this it seems I couldn't use the typewriter, since it didn't gave me those options.
    I had to use a Textfield and make it read only.
    I entered the text under "Options > Default Value" and it gives me only the following options for alignment:
    Alignment - Left, Center, Right
    It doesn't give me the option to justify text, and some of these texts are multiple lines.
    So I was wondering if there is a Javascipt entry that would make the text justified?
    And if there is, what other options should I use with it to make it work correctly?
    (such as should I allow rich text formatted?)

    hmm... the screenshot attached shows the only options given to me by Text Field Poperties when using the "Select Objects" arrow
    Are there options it is not showing me? That bar is the only one that comes up when pressing Ctrl+E
    no Alignment button present.
    When pressing "More..." it shows up the other Text Field Properties menu where the text is entered.

Maybe you are looking for

  • How can I change my iCloud username

    How can I change my apple iCloud username!

  • 10.4 to 10.5--now updates are quitting

    Installed the 10.5 leopard updgrade on iMac. Used CD that came with iMac (waited a year or two before doing this). Now have following issues: Software Update quits unexpectedly Any OS update (downloaded through www, not update) quits unexpectedly Any

  • Help in 2D-array

    how do I output this 1 22 333 4444 55555 6666 777 88 9 using 2D-array???

  • Re-order Point Planning -- PR

    Dear Team, I have created a Purchase Requisition manually. Same is not being considered for MRP run for re-order point planning. System is creating new Purchase Requisition when i run MRP. Where we have gone wrong? Thanks and Regards, RC

  • Disable the save option in axAcroPDF1 control in c# winforms

    In my c# winform application i want to display pdf in axAcroPDF1 control.I am able to do that.But i dont want the save option.Any body knows how to disble the save option in axAcroPDF1 control...????