Esempio n. 1
0
    void push_face(face_ptr& in){
      if (mFaceRecycle.size() > 0 && manual_clean_up){
	long i = mFaceRecycle.back();
	in->position_in_set() = i;
	mFaceRecycle.pop_back();
	mFaces[i] = in;
      }
      else{
	mFaces.push_back(in);
	in->position_in_set() = mFaces.size()-1;
      }
    }
Esempio n. 2
0
cairo_face::cairo_face(std::shared_ptr<font_library> const& library, face_ptr const& face)
    : face_(face)
{
    static cairo_user_data_key_t key;
    c_face_ = cairo_ft_font_face_create_for_ft_face(face->get_face(), FT_LOAD_NO_HINTING);
    cairo_font_face_set_user_data(c_face_, &key, new handle(library, face), destroy);
}
Esempio n. 3
0
cairo_face::cairo_face(boost::shared_ptr<freetype_engine> const& engine, face_ptr const& face)
    : face_(face)
{
    static cairo_user_data_key_t key;
    c_face_ = cairo_ft_font_face_create_for_ft_face(face->get_face(), FT_LOAD_NO_HINTING);
    cairo_font_face_set_user_data(c_face_, &key, new handle(engine, face), destroy);
}
Esempio n. 4
0
    bool slerp_face(T t, face_ptr fi, face_ptr fj){
      coordinate_type Ni = fi->normal();
      coordinate_type Nj = fj->normal();
      coordinate_type ceni = fi->calculate_center();
      coordinate_type cenj = fj->calculate_center();			
      face_vertex_ptr itb = fi->fbegin(), ite = fi->fend();
      face_vertex_ptr jtb = fj->fbegin(), jte = fj->fend();
      bool at_head = false;
      while (!at_head) {
	at_head = itb == ite;
				
	coordinate_type ci = itb->coordinate()-ceni;
	coordinate_type cip = itb->next()->coordinate()-ceni;				
	coordinate_type cj = rotate_to_plane(Ni,Nj,cenj,jtb->coordinate());
	//mOrient.push_back(ci + ceni);
	//mOrient.push_back(cj + ceni);
	coordinate_type cij = blend(t,ci,Ni,cj);				
	itb->coordinate() = cij + ceni;
				
	//				coordinate_type ci = rotate_to_xy(Ni,ceni,itb->coordinate()); 
	//				coordinate_type cip = rotate_to_xy(Ni,ceni,itb->next()->coordinate()); 				
	//				coordinate_type cj = rotate_to_xy(Nj,cenj,jtb->coordinate()); 
	//				coordinate_type cjp = rotate_to_xy(Nj,cenj,jtb->next()->coordinate()); 								
	//
	//				mOrient.push_back(ci + ceni);
	//				mOrient.push_back(cj + ceni);
	//				
	//				coordinate_type cij = blend(t,ci,Eigen::Matrix<T,4,1>(0,0,1),cj);				
	//				itb->coordinate() = rotate_from_xy(Ni,ceni,cij);
				
				
	itb = itb->next();
	jtb = jtb->prev();				
      }
      fi->update_normal();
      fi->update_center();
      cout << endl;
      cout << "---------" << endl;
      return true;
			
    }
Esempio n. 5
0
font_face_cache_key font_face_cache::make_face_key(const face_ptr font_face, double size)
{
    std::string font_name ( font_face->get_face()->family_name);
    font_name.append(font_face->get_face()->style_name);
    return std::make_pair(font_name, size);
}