[Geoserver-users] labeling problem with font size

hi,
for some strange reason geoserver doesn't change the stylining included in
(see a piece of SLD below); nor the font-family nor font-size... are applied
on GetMap when they are modified. But, for example, <Halo> is sensible to
these changes.
I wonder, why?? the SLD below is extracted from
http://geoserver.org/display/GEOSDOC/ComplexLabelingExample and Geoserver
doesn't complain about anything.

Some idea?
ah, congratulations for GeoExt Styler! I wonder if styling labels will be
also possible on the near future?

thanks

         <Rule>
         <MaxScaleDenominator>52000000</MaxScaleDenominator>
          <TextSymbolizer>
          <Label>
        <ogc:PropertyName>code</ogc:PropertyName>
      </Label>
              
      <CssParameter name="font-family">Verdana</CssParameter>
      <CssParameter name="font-style">Normal</CssParameter>
      <CssParameter name="font-size">20</CssParameter>
        
              <!-- this centers the label on the polygon's centroid-->
        <LabelPlacement>
          <PointPlacement>
            <AnchorPoint>
          <AnchorPointX>0.5</AnchorPointX>
          <AnchorPointY>0.5</AnchorPointY>
        </AnchorPoint>
          </PointPlacement>
        </LabelPlacement>

        <Halo>
          <Radius>
       <ogc:Literal>8</ogc:Literal>
          </Radius>
          <Fill>
      <CssParameter name="fill">#FFFFFF</CssParameter>
      <CssParameter name="fill-opacity">0.7</CssParameter>
          </Fill>
        </Halo>
            </TextSymbolizer>
        </Rule>
--
View this message in context: http://www.nabble.com/labeling-problem-with-font-size-tp21850830p21850830.html
Sent from the GeoServer - User mailing list archive at Nabble.com.

It looks like you are missing a "<Font>" element. I believe it should be:

<Font>
   <CssParameter name="font-family">Verdana</CssParameter>
   <CssParameter name="font-style">Normal</CssParameter>
   <CssParameter name="font-size">20</CssParameter>
</Font>

Also, are you using the styler extension from 1.7.2? Support for styling labels is available in it.

-Justin

pere roca wrote:

hi, for some strange reason geoserver doesn't change the stylining included in (see a piece of SLD below); nor the font-family nor font-size... are applied
on GetMap when they are modified. But, for example, <Halo> is sensible to
these changes.
I wonder, why?? the SLD below is extracted from
http://geoserver.org/display/GEOSDOC/ComplexLabelingExample and Geoserver
doesn't complain about anything.

Some idea? ah, congratulations for GeoExt Styler! I wonder if styling labels will be
also possible on the near future?

thanks

         <Rule>
         <MaxScaleDenominator>52000000</MaxScaleDenominator>
          <TextSymbolizer>
          <Label>
        <ogc:PropertyName>code</ogc:PropertyName>
      </Label>
                    <CssParameter name="font-family">Verdana</CssParameter>
      <CssParameter name="font-style">Normal</CssParameter>
      <CssParameter name="font-size">20</CssParameter>
        
              <!-- this centers the label on the polygon's centroid-->
        <LabelPlacement>
          <PointPlacement> <AnchorPoint>
          <AnchorPointX>0.5</AnchorPointX>
          <AnchorPointY>0.5</AnchorPointY>
        </AnchorPoint>
          </PointPlacement> </LabelPlacement>

        <Halo> <Radius>
       <ogc:Literal>8</ogc:Literal>
          </Radius>
          <Fill>
      <CssParameter name="fill">#FFFFFF</CssParameter>
      <CssParameter name="fill-opacity">0.7</CssParameter> </Fill>
        </Halo>
            </TextSymbolizer>
        </Rule>

--
Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.

sorry, it was my fault when typing the message; the Font element is on the SLD and I can appreciate some changes but… just an example: what do I have to do if I want the province names much bigger (see first GetMap below)? I have applied a font-size= 2000 but I just see a very little difference with a GetMap applying the old style (without font-size; see second GetMap) ; it seems as if there is a limit… depending on what?

thanks in advance,

Pere

APPLYING STYLE (eu_negro3 with font-size 2000)

http://edit.csic.es/geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=topp:province_iberia,topp:test_csvimportgispoints2&SRS=EPSG:4326&BBOX=-0.6934896568304696,40.02588284415445,4.120762384103197,42.765026246754644&WIDTH=1132&HEIGHT=556&FORMAT=image/png&styles=eu_negro3,&TRANSPARENT=TRUE&UNIQUEID=

NO STYLE

http://edit.csic.es/geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=topp:province_iberia,topp:test_csvimportgispoints2&SRS=EPSG:4326&BBOX=-0.6934896568304696,40.02588284415445,4.120762384103197,42.765026246754644&WIDTH=1132&HEIGHT=556&FORMAT=image/png&styles=&TRANSPARENT=TRUE&UNIQUEID=

that part of SLD is correct but seems not enough??..

Verdana
Normal
2000

2009/2/5 Justin Deoliveira <jdeolive@anonymised.com.1671…>

It looks like you are missing a “” element. I believe it should be:

Verdana Normal 20

Also, are you using the styler extension from 1.7.2? Support for styling labels is available in it.

-Justin

pere roca wrote:

hi, for some strange reason geoserver doesn’t change the stylining included in (see a piece of SLD below); nor the font-family nor font-size… are applied
on GetMap when they are modified. But, for example, is sensible to
these changes.
I wonder, why?? the SLD below is extracted from
http://geoserver.org/display/GEOSDOC/ComplexLabelingExample and Geoserver
doesn’t complain about anything.
Some idea? ah, congratulations for GeoExt Styler! I wonder if styling labels will be
also possible on the near future?

thanks

52000000 code Verdana Normal 20 0.5 0.5 8 #FFFFFF 0.7


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.


Pere Roca Ristol
Biòleg i especialista GIS
Museo Nacional de Ciencias Naturales (CSIC)
Visita l’EDIT mapViewer!
http://edit.csic.es/edit_geo/prototype/edit.html

Hi Pere,

Are you sure the font is found? That doesn’t seem to be Verdana. I had these problems in Linux and fixed them by copying ttf-fonts from Windows and then applying the whole path to the font-family tag, like:

/path-to-directory-where-I-copied-the-ttf-file/Verdana.ttf

  • mika -

pere roca ristol kirjoitti:

pere roca ristol ha scritto:

sorry, it was my fault when typing the message; the Font element is on the SLD and I can appreciate some changes but... just an example: what do I have to do if I want the province names much bigger (see first GetMap below)? I have applied a font-size= 2000 but I just see a very little difference with a GetMap applying the old style (without font-size; see second GetMap) ; it seems as if there is a limit... depending on what?

There is no limit, I've just tried setting the population style
label size to 30, Verdana, at here is the result.

Have you done the usual apply-save cycle after submitting changes
to the style?

Cheers
Andrea

--
Andrea Aime
OpenGeo - http://opengeo.org
Expert service straight from the developers.

stateBigFont.png

that is! the Fonts where not there and Geoserver was missing the Font tag; now it works after setting the full path to fonts.
I’m wondering why the fonts where not there (are not installed along with Geoserver?) and how to make a cleaner solution (avoiding to write full path to fonts).

thank you very much!
Pere

2009/2/5 Mika Lehtonen <mika@anonymised.com>

Hi Pere,

Are you sure the font is found? That doesn’t seem to be Verdana. I had these problems in Linux and fixed them by copying ttf-fonts from Windows and then applying the whole path to the font-family tag, like:

/path-to-directory-where-I-copied-the-ttf-file/Verdana.ttf

  • mika -

pere roca ristol kirjoitti:

sorry, it was my fault when typing the message; the Font element is on the SLD and I can appreciate some changes but… just an example: what do I have to do if I want the province names much bigger (see first GetMap below)? I have applied a font-size= 2000 but I just see a very little difference with a GetMap applying the old style (without font-size; see second GetMap) ; it seems as if there is a limit… depending on what?

thanks in advance,

Pere

APPLYING STYLE (eu_negro3 with font-size 2000)

http://edit.csic.es/geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=topp:province_iberia,topp:test_csvimportgispoints2&SRS=EPSG:4326&BBOX=-0.6934896568304696,40.02588284415445,4.120762384103197,42.765026246754644&WIDTH=1132&HEIGHT=556&FORMAT=image/png&styles=eu_negro3,&TRANSPARENT=TRUE&UNIQUEID=

NO STYLE

http://edit.csic.es/geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=topp:province_iberia,topp:test_csvimportgispoints2&SRS=EPSG:4326&BBOX=-0.6934896568304696,40.02588284415445,4.120762384103197,42.765026246754644&WIDTH=1132&HEIGHT=556&FORMAT=image/png&styles=&TRANSPARENT=TRUE&UNIQUEID=

that part of SLD is correct but seems not enough??..

Verdana
Normal
2000

2009/2/5 Justin Deoliveira <jdeolive@anonymised.com1…>

It looks like you are missing a “” element. I believe it should be:

Verdana Normal 20

Also, are you using the styler extension from 1.7.2? Support for styling labels is available in it.

-Justin

pere roca wrote:

hi, for some strange reason geoserver doesn’t change the stylining included in (see a piece of SLD below); nor the font-family nor font-size… are applied
on GetMap when they are modified. But, for example, is sensible to
these changes.
I wonder, why?? the SLD below is extracted from
http://geoserver.org/display/GEOSDOC/ComplexLabelingExample and Geoserver
doesn’t complain about anything.
Some idea? ah, congratulations for GeoExt Styler! I wonder if styling labels will be
also possible on the near future?

thanks

52000000 code Verdana Normal 20 0.5 0.5 8 #FFFFFF 0.7


Justin Deoliveira
OpenGeo - http://opengeo.org
Enterprise support for open source geospatial.


Pere Roca Ristol
Biòleg i especialista GIS
Museo Nacional de Ciencias Naturales (CSIC)
Visita l’EDIT mapViewer!
http://edit.csic.es/edit_geo/prototype/edit.html


---

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-[http://p.sf.net/sfu/adobe-com](http://p.sf.net/sfu/adobe-com)

---

_______________________________________________
Geoserver-users mailing list
[Geoserver-users@lists.sourceforge.net](mailto:Geoserver-users@lists.sourceforge.net)
[https://lists.sourceforge.net/lists/listinfo/geoserver-users](https://lists.sourceforge.net/lists/listinfo/geoserver-users)
  


Pere Roca Ristol
Biòleg i especialista GIS
Museo Nacional de Ciencias Naturales (CSIC)
Visita l’EDIT mapViewer!
http://edit.csic.es/edit_geo/prototype/edit.html

Those fonts cannot be distributed with GeoServer (or Linux distributions) for legal reasons, but most distributions have instructions on how to install them. However, the JVM doesn't always look in the right places, so see the last paragraph of

http://geoserver.org/display/GEOSDOC/1.1.4+CentOS+(Red+Hat)+5.1+Install

That's the lazy way of making sure Java will find them.

-Arne

pere roca ristol wrote:

   that is! the Fonts where not there and Geoserver was missing the Font tag; now it works after setting the full path to fonts.
   I'm wondering why the fonts where not there (are not installed along with Geoserver?) and how to make a cleaner solution (avoiding to write full path to fonts).

  thank you very much!
  Pere

2009/2/5 Mika Lehtonen <mika@anonymised.com <mailto:mika@anonymised.com>>

    Hi Pere,

    Are you sure the font is found? That doesn't seem to be Verdana. I
    had these problems in Linux and fixed them by copying ttf-fonts
    from Windows and then applying the whole path to the font-family
    tag, like:

    <CssParameter
    name="font-family">/path-to-directory-where-I-copied-the-ttf-file/Verdana.ttf</CssParameter>

    - mika -

    pere roca ristol kirjoitti:

    sorry, it was my fault when typing the message; the Font element
    is on the SLD and I can appreciate some changes but... just an
    example: what do I have to do if I want the province names much
    bigger (see first GetMap below)? I have applied a font-size=
    2000 but I just see a very little difference with a GetMap
    applying the old style (without font-size; see second GetMap) ;
    it seems as if there is a limit... depending on what?

    thanks in advance,

    Pere

    APPLYING STYLE (eu_negro3 with font-size 2000)

    http://edit.csic.es/geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=topp:province_iberia,topp:test_csvimportgispoints2&SRS=EPSG:4326&BBOX=-0.6934896568304696,40.02588284415445,4.120762384103197,42.765026246754644&WIDTH=1132&HEIGHT=556&FORMAT=image/png&styles=eu_negro3,&TRANSPARENT=TRUE&UNIQUEID=
    <http://edit.csic.es/geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=topp:province_iberia,topp:test_csvimportgispoints2&SRS=EPSG:4326&BBOX=-0.6934896568304696,40.02588284415445,4.120762384103197,42.765026246754644&WIDTH=1132&HEIGHT=556&FORMAT=image/png&styles=eu_negro3,&TRANSPARENT=TRUE&UNIQUEID=&gt;

    NO STYLE

    http://edit.csic.es/geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=topp:province_iberia,topp:test_csvimportgispoints2&SRS=EPSG:4326&BBOX=-0.6934896568304696,40.02588284415445,4.120762384103197,42.765026246754644&WIDTH=1132&HEIGHT=556&FORMAT=image/png&styles=&TRANSPARENT=TRUE&UNIQUEID=
    <http://edit.csic.es/geoserver/wms?VERSION=1.1.1&REQUEST=GetMap&SERVICE=WMS&LAYERS=topp:province_iberia,topp:test_csvimportgispoints2&SRS=EPSG:4326&BBOX=-0.6934896568304696,40.02588284415445,4.120762384103197,42.765026246754644&WIDTH=1132&HEIGHT=556&FORMAT=image/png&styles=&TRANSPARENT=TRUE&UNIQUEID=&gt;

    that part of SLD is correct but seems not enough??...
    <Font> <CssParameter name="font-family">Verdana</CssParameter> <CssParameter name="font-style">Normal</CssParameter> <CssParameter name="font-size">2000</CssParameter> </Font>
    2009/2/5 Justin Deoliveira <jdeolive@anonymised.com
    <mailto:jdeolive@anonymised.com>>

        It looks like you are missing a "<Font>" element. I believe
        it should be:

        <Font>
         <CssParameter name="font-family">Verdana</CssParameter>
         <CssParameter name="font-style">Normal</CssParameter>
         <CssParameter name="font-size">20</CssParameter>
        </Font>

        Also, are you using the styler extension from 1.7.2? Support
        for styling labels is available in it.

        -Justin

        pere roca wrote:

            hi, for some strange reason geoserver doesn't change the
            stylining included in (see a piece of SLD below); nor the
            font-family nor font-size... are applied
            on GetMap when they are modified. But, for example,
            <Halo> is sensible to
            these changes.
            I wonder, why?? the SLD below is extracted from
            http://geoserver.org/display/GEOSDOC/ComplexLabelingExample
             and Geoserver
            doesn't complain about anything.
            Some idea? ah, congratulations for GeoExt Styler! I
            wonder if styling labels will be
            also possible on the near future?

            thanks

                    <Rule>
                    <MaxScaleDenominator>52000000</MaxScaleDenominator>
                     <TextSymbolizer>
                     <Label>
                   <ogc:PropertyName>code</ogc:PropertyName>
                 </Label>
                               <CssParameter
            name="font-family">Verdana</CssParameter>
                 <CssParameter name="font-style">Normal</CssParameter>
                 <CssParameter name="font-size">20</CssParameter>
                                            <!-- this centers the label on the polygon's
            centroid-->
                   <LabelPlacement>
                     <PointPlacement> <AnchorPoint>
                     <AnchorPointX>0.5</AnchorPointX>
                     <AnchorPointY>0.5</AnchorPointY>
                   </AnchorPoint>
                     </PointPlacement> </LabelPlacement> <Halo> <Radius>
                  <ogc:Literal>8</ogc:Literal>
                     </Radius>
                     <Fill>
                 <CssParameter name="fill">#FFFFFF</CssParameter>
                 <CssParameter name="fill-opacity">0.7</CssParameter>
                             </Fill>
                   </Halo>
                       </TextSymbolizer>
                   </Rule>

        -- Justin Deoliveira
        OpenGeo - http://opengeo.org
        Enterprise support for open source geospatial.

    -- Pere Roca Ristol
    Biòleg i especialista GIS
    Museo Nacional de Ciencias Naturales (CSIC)
    Visita l'EDIT mapViewer!
    http://edit.csic.es/edit_geo/prototype/edit.html
    ------------------------------------------------------------------------

    ------------------------------------------------------------------------------
    Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
    software. With Adobe AIR, Ajax developers can use existing skills and code to
    build responsive, highly engaging applications that combine the power of local
    resources and data with the reach of the web. Download the Adobe AIR SDK and
    Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
    ------------------------------------------------------------------------

    _______________________________________________
    Geoserver-users mailing list
    Geoserver-users@lists.sourceforge.net <mailto:Geoserver-users@anonymised.comsourceforge.net>
    https://lists.sourceforge.net/lists/listinfo/geoserver-users
      
--
Pere Roca Ristol
Biòleg i especialista GIS
Museo Nacional de Ciencias Naturales (CSIC)
Visita l'EDIT mapViewer!
http://edit.csic.es/edit_geo/prototype/edit.html
------------------------------------------------------------------------

------------------------------------------------------------------------------
Create and Deploy Rich Internet Apps outside the browser with Adobe(R)AIR(TM)
software. With Adobe AIR, Ajax developers can use existing skills and code to
build responsive, highly engaging applications that combine the power of local
resources and data with the reach of the web. Download the Adobe AIR SDK and
Ajax docs to start building applications today-http://p.sf.net/sfu/adobe-com
------------------------------------------------------------------------

_______________________________________________
Geoserver-users mailing list
Geoserver-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/geoserver-users
  
--
Arne Kepp
OpenGeo - http://opengeo.org
Expert service straight from the developers