<commit_before>/*****************************************************************************
 *
 * This file is part of Mapnik (c++ mapping toolkit)
 *
 * Copyright (C) 2006 <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 *****************************************************************************/

//$Id$

//mapnik
#include <mapnik/text_symbolizer.hpp>
// boost
#include <boost/scoped_ptr.hpp>

namespace mapnik
{

static const char * label_placement_strings[] = {
    "point",
    "line",
    "vertex",
    ""
};


IMPLEMENT_ENUM( label_placement_e, label_placement_strings );

static const char * vertical_alignment_strings[] = {
    "top",
    "middle",
    "bottom",
    ""
};


IMPLEMENT_ENUM( vertical_alignment_e, vertical_alignment_strings );

static const char * horizontal_alignment_strings[] = {
    "left",
    "middle",
    "right",
    ""
};


IMPLEMENT_ENUM( horizontal_alignment_e, horizontal_alignment_strings );

static const char * justify_alignment_strings[] = {
    "left",
    "middle",
    "right",
    ""
};


IMPLEMENT_ENUM( justify_alignment_e, justify_alignment_strings );

static const char * text_transform_strings[] = {
    "none",
    "uppercase",
    "lowercase",
    ""
};


IMPLEMENT_ENUM( text_transform_e, text_transform_strings );



text_symbolizer::text_symbolizer(expression_ptr name, std::string const& face_name, unsigned size, color const& fill)
    : symbolizer_base(),
      name_(name),
      face_name_(face_name),
      //fontset_(default_fontset),
      size_(size),
      text_ratio_(0),
      wrap_width_(0),
      wrap_char_(' '),
      text_transform_(NONE),
      line_spacing_(0),
      character_spacing_(0),
      label_spacing_(0),
      label_position_tolerance_(0),
      force_odd_labels_(false),
      max_char_angle_delta_(0.0),
      fill_(fill),
      halo_fill_(color(255,255,255)),
      halo_radius_(0),
      label_p_(POINT_PLACEMENT),
      valign_(MIDDLE),
      anchor_(0.0,0.5),
      displacement_(0.0,0.0),
      avoid_edges_(false),
      minimum_distance_(0.0),
      overlap_(false),
      text_opacity_(1.0),
      wrap_before_(false),
      halign_(H_MIDDLE),
      jalign_(J_MIDDLE) {}

text_symbolizer::text_symbolizer(expression_ptr name, unsigned size, color const& fill)
    : symbolizer_base(),
      name_(name),
      //face_name_(""),
      //fontset_(default_fontset),
      size_(size),
      text_ratio_(0),
      wrap_width_(0),
      wrap_char_(' '),
      text_transform_(NONE),
      line_spacing_(0),
      character_spacing_(0),
      label_spacing_(0),
      label_position_tolerance_(0),
      force_odd_labels_(false),
      max_char_angle_delta_(0.0),
      fill_(fill),
      halo_fill_(color(255,255,255)),
      halo_radius_(0),
      label_p_(POINT_PLACEMENT),
      valign_(MIDDLE),
      anchor_(0.0,0.5),
      displacement_(0.0,0.0),
      avoid_edges_(false),
      minimum_distance_(0.0),
      overlap_(false),
      text_opacity_(1.0),
      wrap_before_(false),
      halign_(H_MIDDLE),
      jalign_(J_MIDDLE) {}

text_symbolizer::text_symbolizer(text_symbolizer const& rhs)
    : symbolizer_base(rhs),
      name_(rhs.name_),
      orientation_(rhs.orientation_),
      face_name_(rhs.face_name_),
      fontset_(rhs.fontset_),
      size_(rhs.size_),
      text_ratio_(rhs.text_ratio_),
      wrap_width_(rhs.wrap_width_),
      wrap_char_(rhs.wrap_char_),
      text_transform_(rhs.text_transform_),
      line_spacing_(rhs.line_spacing_),
      character_spacing_(rhs.character_spacing_),
      label_spacing_(rhs.label_spacing_),<commit_msg>+ max_char_angle default to 25 degrees<commit_after>/*****************************************************************************
 *
 * This file is part of Mapnik (c++ mapping toolkit)
 *
 * Copyright (C) 2006 <NAME>
 *
 * This library is free software; you can redistribute it and/or
 * modify it under the terms of the GNU Lesser General Public
 * License as published by the Free Software Foundation; either
 * version 2.1 of the License, or (at your option) any later version.
 *
 * This library is distributed in the hope that it will be useful,
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 * Lesser General Public License for more details.
 *
 * You should have received a copy of the GNU Lesser General Public
 * License along with this library; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301  USA
 *
 *****************************************************************************/

//$Id$

//mapnik
#include <mapnik/text_symbolizer.hpp>
// boost
#include <boost/scoped_ptr.hpp>

namespace mapnik
{

static const char * label_placement_strings[] = {
    "point",
    "line",
    "vertex",
    ""
};


IMPLEMENT_ENUM( label_placement_e, label_placement_strings );

static const char * vertical_alignment_strings[] = {
    "top",
    "middle",
    "bottom",
    ""
};


IMPLEMENT_ENUM( vertical_alignment_e, vertical_alignment_strings );

static const char * horizontal_alignment_strings[] = {
    "left",
    "middle",
    "right",
    ""
};


IMPLEMENT_ENUM( horizontal_alignment_e, horizontal_alignment_strings );

static const char * justify_alignment_strings[] = {
    "left",
    "middle",
    "right",
    ""
};


IMPLEMENT_ENUM( justify_alignment_e, justify_alignment_strings );

static const char * text_transform_strings[] = {
    "none",
    "uppercase",
    "lowercase",
    ""
};


IMPLEMENT_ENUM( text_transform_e, text_transform_strings );



text_symbolizer::text_symbolizer(expression_ptr name, std::string const& face_name, unsigned size, color const& fill)
    : symbolizer_base(),
      name_(name),
      face_name_(face_name),
      //fontset_(default_fontset),
      size_(size),
      text_ratio_(0),
      wrap_width_(0),
      wrap_char_(' '),
      text_transform_(NONE),
      line_spacing_(0),
      character_spacing_(0),
      label_spacing_(0),
      label_position_tolerance_(0),
      force_odd_labels_(false),
      max_char_angle_delta_(25.0 * M_PI/180.0),
      fill_(fill),
      halo_fill_(color(255,255,255)),
      halo_radius_(0),
      label_p_(POINT_PLACEMENT),
      valign_(MIDDLE),
      anchor_(0.0,0.5),
      displacement_(0.0,0.0),
      avoid_edges_(false),
      minimum_distance_(0.0),
      overlap_(false),
      text_opacity_(1.0),
      wrap_before_(false),
      halign_(H_MIDDLE),
      jalign_(J_MIDDLE) {}

text_symbolizer::text_symbolizer(expression_ptr name, unsigned size, color const& fill)
    : symbolizer_base(),
      name_(name),
      //face_name_(""),
      //fontset_(default_fontset),
      size_(size),
      text_ratio_(0),
      wrap_width_(0),
      wrap_char_(' '),
      text_transform_(NONE),
      line_spacing_(0),
      character_spacing_(0),
      label_spacing_(0),
      label_position_tolerance_(0),
      force_odd_labels_(false),
      max_char_angle_delta_(25.0 * M_PI/180.0),
      fill_(fill),
      halo_fill_(color(255,255,255)),
      halo_radius_(0),
      label_p_(POINT_PLACEMENT),
      valign_(MIDDLE),
      anchor_(0.0,0.5),
      displacement_(0.0,0.0),
      avoid_edges_(false),
      minimum_distance_(0.0),
      overlap_(false),
      text_opacity_(1.0),
      wrap_before_(false),
      halign_(H_MIDDLE),
      jalign_(J_MIDDLE) {}

text_symbolizer::text_symbolizer(text_symbolizer const& rhs)
    : symbolizer_base(rhs),
      name_(rhs.name_),
      orientation_(rhs.orientation_),
      face_name_(rhs.face_name_),
      fontset_(rhs.fontset_),
      size_(rhs.size_),
      text_ratio_(rhs.text_ratio_),
      wrap_width_(rhs.wrap_width_),
      wrap_char_(rhs.wrap_char_),
      text_transform_(rhs.text_transform_),
      line_spacing_(rhs.line_spacing_),
      character_spacing_(rhs.character_spacing_),
      label_spacing_(rhs.label_spacing_),
{'fraction_non_alphanumeric': 0.14674735249621784, 'fraction_numerical': 0.019318049575235658, 'mean_word_length': 3.561571125265393, 'pattern_counts': {'":': 0, '<': 9, '<?xml version=': 0, '>': 9, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5770315', 'n_tokens_mistral': 2794, 'n_tokens_neox': 2707, 'n_words': 566}