<div dir="ltr"><br><div class="gmail_extra"><br><div class="gmail_quote">2013/5/28 Marco Hugentobler <span dir="ltr"><<a href="mailto:marco.hugentobler@sourcepole.ch" target="_blank">marco.hugentobler@sourcepole.ch</a>></span><br>
<blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
  
    
  
  <div text="#000000" bgcolor="#FFFFFF">
    <div><div class="im">>So for me, simply removing the
      adjustSizeToText call would be enough. Or we have to make sure
      this method does the job correctly, which may be a bit hard to
      implement : we need to avoid to have >collision with other
      composition items, etc.<br>
      <br></div>
      The problem is if the client provided text does not fit into the
      predefined label box. </div></div></blockquote><div><br></div><div>I agree, but it is better than "now", and quite logical to me : if the content does not fit, only the part which fits is visible. This allows the output PDF to be like the author wanted to, with the position and size of each text box as set in the Composer. And above all, text wraps correctly without dynamic resize. We could try to add an option "max length" for the text boxes which could be advertised in the getCapabilities ? This way the client could warn the user whenever he tries to use a text which too many characters ?<br>
</div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><div>It would be good to combine dynamic resize
      capabilities with line breaks somehow.<br></div></div></blockquote><div><br></div><div>I think dynamic resize should be used only if we can use it with line breaks.Better respect the position and size defined by the user in QGIS composer than having a text item which get so long that it get out of the composer limits.<br>
<br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF"><div>
      I'm open for suggestions.<span class="HOEnZb"><font color="#888888"><br></font></span></div></div></blockquote><div><br></div><div>Thanks, and please forgive my english which sometimes prevents me from souding moderate enough. I know that giving ideas is easy and developping features is harder !<br>
<br></div><div>Some suggestions (I am thinking out loud...)<br><br></div><div>* new option with max text length, advertised in the getCapabilities<br></div><div>* linked text boxes. In softwares like Adobe Illustrator, or Scribus (open-source), you can link serveral text boxes, so that the text is written is the first box then in the linked one if the content does not fit the first one. <br>
</div><div>* If "linked" text boxes is implemented, the killer feature would have to dynamically generate new pages with linked text boxes so that all the content is written in as many boxes as necessary to have the full content written down.<br>
<br></div><div>Sincerely<br></div><div>Michael<br></div><div><br></div><div> </div><blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex"><div text="#000000" bgcolor="#FFFFFF">
<div><span class="HOEnZb"><font color="#888888">
      <br>
      Marco</font></span><div><div class="h5"><br>
      <br>
      <br>
      On 28.05.2013 11:53, kimaidou wrote:<br>
    </div></div></div><div><div class="h5">
    <blockquote type="cite">
      <div dir="ltr">
        <div>
          <div>
            <div>
              <div>
                <div>
                  <div>
                    <div>Hi<br>
                      <br>
                    </div>
                    I just made a small test and commented the line<br>
                    currentLabel->adjustSizeToText();<br>
                  </div>
                  Then recompile QGIS master and tested it with a
                  classical text box (not html rendered) with a long
                  text.<br>
                  <br>
                </div>
                I personnaly prefer the behaviour when this method is
                not called : the text box keep the size set by the user
                in QGIS. And the text wraps when it reaches the right
                side of the Box. I even tried with "HTML rendered" on
                (and my fake X Server running), and it worked well too.<br>
                <br>
              </div>
              At the contrary, when adjustSizeToText is used, the box is
              transformed in a one line box, which goes to the right of
              the entire composition (out of it) : text does not wrap. <br>
              <br>
            </div>
            So for me, simply removing the adjustSizeToText call would
            be enough. Or we have to make sure this method does the job
            correctly, which may be a bit hard to implement : we need to
            avoid to have collision with other composition items, etc.<br>
            <br>
          </div>
          Regards<br>
        </div>
        Michael<br>
        <div>
          <div>
            <div>
              <div>
                <div><br>
                </div>
              </div>
            </div>
          </div>
        </div>
      </div>
      <div class="gmail_extra"><br>
        <br>
        <div class="gmail_quote">2013/5/28 René-Luc D'Hont <span dir="ltr"><<a href="mailto:rldhont@gmail.com" target="_blank">rldhont@gmail.com</a>></span><br>
          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div dir="ltr">Hi Marco<br>
              <div>
                <div class="gmail_extra"><br>
                  <div class="gmail_quote">
                    <div>
                      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                        <div>
                          <br>
                        </div>
                        I guess yes. 'adjustSizeToText()' works for
                        text, not html. Html support for composer label
                        was added recently to the composer label class.
                        Please adapt the relevant lines to work with
                        html labels too. </blockquote>
                      <div><br>
                      </div>
                    </div>
                    <div>I'll adapt it<br>
                    </div>
                    <div>
                      <div> </div>
                      <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                        <div>
                          <br>
                          >Question for Marco, Why removed label, if
                          the request doesn't define a value ? Why not
                          used the default value ?<br>
                          <br>
                        </div>
                        The idea was that the web client has the
                        possibility to remove an advertised text label
                        completely if it is not used. E.g. if a
                        composition defines a text item with id
                        'author', the web client can simply ignore it if
                        it does not want to have author's name printed.
                        Note that the labels without ids are not removed
                        as they are considered to be fix, so not subject
                        to client text replacement (original meaning of
                        label id was that this text item is subject to
                        text replacement by web client. Later, the id
                        has been generalized as an id for every item
                        type).<br>
                        <br>
                        Another possibility would be to remove the item
                        only if the client gives an empty text and use
                        the default text otherwise. What do you think?<br>
                      </blockquote>
                      <div><br>
                        <br>
                      </div>
                    </div>
                    <div>I prefer to remove the label only if the user
                      gives an empty text.<br>
                    </div>
                    <div>Can I do it ?<br>
                      <br>
                      <br>
                    </div>
                    <div>Regards,<br>
                    </div>
                    <div>René-Luc<br>
                    </div>
                    <div>
                      <div>
                        <div> <br>
                          <br>
                          On <a href="tel:27.05.2013%2022" value="+12705201322" target="_blank">27.05.2013
                            22</a>:23, rldhont wrote:<br>
                        </div>
                        <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                          <blockquote class="gmail_quote" style="margin:0 0 0 .8ex;border-left:1px #ccc solid;padding-left:1ex">
                            <div>
                              <div>
                                Hi Marco and other devs,<br>
                                <br>
                                In src/mapserver/qgsconfigparser.cpp:530
                                we can read :<br>
                                <br>
                                  //replace label text<br>
                                  foreach ( QgsComposerLabel
                                *currentLabel, composerLabels )<br>
                                  {<br>
                                    QString title = parameterMap.value(
                                currentLabel->id().toUpper() );<br>
                                <br>
                                    if ( title.isEmpty() )<br>
                                    {<br>
                                      //remove exported labels not
                                referenced in the request<br>
                                      if (
                                !currentLabel->id().isEmpty() )<br>
                                      {<br>
                                        c->removeItem( currentLabel
                                );<br>
                                        delete currentLabel;<br>
                                      }<br>
                                      continue;<br>
                                    }<br>
                                <br>
                                    currentLabel->setText( title );<br>
                                    currentLabel->adjustSizeToText();<br>
                                  }<br>
                                <br>
                                This code is used to draw composer label
                                with value defined by the QGIS WMS
                                Server Request GetPrint.<br>
                                <br>
                                The bug defined in the issues #7894 <a href="http://hub.qgis.org/issues/7894" target="_blank">http://hub.qgis.org/issues/7894</a>
                                is probably du to the method
                                adjustSizeToText()<br>
                                Someone can confim it ?<br>
                                <br>
                                Question for Marco, Why removed label,
                                if the request doesn't define a value ?
                                Why not used the default value ?<br>
                                <br>
                                Regards,<br>
                                René-Luc D'Hont<br>
                                3Liz<br>
                              </div>
                            </div>
                            _______________________________________________<br>
                            Qgis-developer mailing list<br>
                            <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
                            <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><span><font color="#888888"><br>
                              </font></span></blockquote>
                          <span><font color="#888888">
                              <br>
                              <br>
                              -- <br>
                              Dr. Marco Hugentobler<br>
                              Sourcepole -  Linux & Open Source
                              Solutions<br>
                              Weberstrasse 5, CH-8004 Zürich,
                              Switzerland<br>
                              <a href="mailto:marco.hugentobler@sourcepole.ch" target="_blank">marco.hugentobler@sourcepole.ch</a>
                              <a href="http://www.sourcepole.ch" target="_blank">http://www.sourcepole.ch</a><br>
                              Technical Advisor QGIS Project Steering
                              Committee<br>
                              <br>
                              _______________________________________________<br>
                              Qgis-developer mailing list<br>
                              <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
                              <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
                            </font></span></blockquote>
                      </div>
                    </div>
                  </div>
                  <br>
                </div>
              </div>
            </div>
            <br>
            _______________________________________________<br>
            Qgis-developer mailing list<br>
            <a href="mailto:Qgis-developer@lists.osgeo.org" target="_blank">Qgis-developer@lists.osgeo.org</a><br>
            <a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
            <br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
    <br>
    <pre cols="72">-- 
Dr. Marco Hugentobler
Sourcepole -  Linux & Open Source Solutions
Weberstrasse 5, CH-8004 Zürich, Switzerland
<a href="mailto:marco.hugentobler@sourcepole.ch" target="_blank">marco.hugentobler@sourcepole.ch</a> <a href="http://www.sourcepole.ch" target="_blank">http://www.sourcepole.ch</a>
Technical Advisor QGIS Project Steering Committee </pre>
  </div></div></div>

<br>_______________________________________________<br>
Qgis-developer mailing list<br>
<a href="mailto:Qgis-developer@lists.osgeo.org">Qgis-developer@lists.osgeo.org</a><br>
<a href="http://lists.osgeo.org/mailman/listinfo/qgis-developer" target="_blank">http://lists.osgeo.org/mailman/listinfo/qgis-developer</a><br>
<br></blockquote></div><br></div></div>