Giter Club home page Giter Club logo

ofxtruetypefontuc's People

Contributors

akira-hayasaka avatar hironishihara avatar jfnet avatar kr15h avatar noyanc avatar yusuketomoto avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

ofxtruetypefontuc's Issues

Visual Studio 2015 - OF0.9 problem

Dear Hironishihara,
Thanks for your kind contribution to the community. I would like to remark an issue I have been experiencing. I am trying to implement your addon for Windows Visual Studio 2015 using of0.9. There seems to be a problem with the addon, because non-Latin characters are printed as ? (question marks) instead. I'd appreciate if you can help us solve this matter.
Kind regards

getStringAsPoints

こんにちは
いつも便利に使わせてもらっています、ありがとうございます

getStringAsPointsでofPathがとれてきていなかったので、

getStringAsPoints

  •            shapes.push_back(getCharacterAsPoints(str[index]));
    
  •            shapes.push_back(getCharacterAsPoints(cy));
    

getCharacterAsPoints

  • if( bMakeContours && (int)charOutlines.size() > 0 && character >= NUM_CHARACTER_TO_START_UC && character - NUM_CHARACTER_TO_START_UC < (int)charOutlines.size() ){
  •    return charOutlines[character-NUM_CHARACTER_TO_START_UC];
    
  • if( bMakeContours && (int)charOutlines.size() > 0) {
  •    return charOutlines[character];
    

のような感じに修正してみました。
ここにフォークしてコミットしてあります
https://github.com/Akira-Hayasaka/ofxTrueTypeFontUC

ご報告でした!

ofRotate doesn't have any effect to the fonts

Hi!
I'm trying to add some letters that rotate on screen but even this example doesn't work, the text appears horizontal on screen:

ofPushMatrix();
ofRotate(0.5);
font->drawStringAsShapes("אבגדהוזחטיכלמנסעפצקרשתםןףץ", 0, ofGetHeight()/2);
ofPopMatrix();

I also tried with "drawString" but the same happens.

VS2012 compile problem

bool ofxTrueTypeFontUC::loadFont(string filename, int fontsize, bool _bAntiAliased, bool makeContours, float _simplifyAmt, int _dpi) {
  mImpl->implLoadFont(filename, fontsize, _bAntiAliased, makeContours, _simplifyAmt, _dpi);
}

lost return value

//------------------------------------------------------------------
ofPath ofxTrueTypeFontUC::getCharacterAsPoints(wstring src) {

#ifdef TARGET_WIN32
  ustring character = util::ofxTrueTypeFontUC::convUTF16ToUCS4(src);
#elif defined(__clang_major__) && (__clang_major__ <= 3)
  wstring character = util::ofxTrueTypeFontUC::convToUCS4<wchar_t>(src);
#else
  wstring character = src;
#endif

  int charID = mImpl->getCharID(character[0]);
  if(mImpl->cps[charID].character == mImpl->kTypefaceUnloaded)
    mImpl->loadChar(charID);

  return mImpl->getCharacterAsPointsFromCharID(charID);
}

ofPath ofxTrueTypeFontUC::getCharacterAsPoints(string character) {
  return getCharacterAsPoints(util::ofxTrueTypeFontUC::convToWString(character));
}

"ustring" undefined
simple fixed by add "typedef basic_string ustring;" before this function
there is a ustring typedef before, but don't know why compiler miss this.

Platform win7 x64, vs2012, of 0.8.0dev

VC++ compiler problem

The library compiles fine for me on xcode and mac, but when using the visual studio compiler I get the error:

error C2864: 
'ofxTrueTypeFontUC::Impl::librariesInitialized': only static const integral data members can be initialized within a class

On line 73 of ofxTrueTypeFontUC.cpp:

bool librariesInitialized = false;

If I remove the declaration:

bool librariesInitialized;

and add it at the top:

public:
    Impl(){librariesInitialized = false;};
    ~Impl(){};

everything appears to work fine.

iOS - no member 'unloadTextures' 'reloadTextures' 'all_fonts'

Hi
I tried to used the addons with OF 0.81 and iOS but got the following Semantic Issue errors:
no member named 'unloadTextures' in 'ofxTrueTypeFonyUC'
no member named 'reloadTextures' in 'ofxTrueTypeFonyUC'
no member named 'all_fonts' in 'TrueTypeFontUC::Impl'

Emoji Support

Hi,

I'm trying to use your library to draw Emoji using Apple's Color Emoji ttf. Unfortunately I am getting this error:

[ error ] ofxTrueTypeFontUC::loadFont - Error with FT_Load_Glyph 112: FT_Error = 22

Code:

// in setup
myFont.loadFont("Apple Color Emoji.ttf", 72);
// in draw
myFont.drawString("🐞", 100, 100);

Thanks in advance!

Including Freetype.h

In OF 10.1 the following didn't work to include freetype:

#include "freetype.h"
#include "ftglyph.h"
#include "ftoutln.h"
#include "fttrigon.h"

I reverted it back so it was including it like so and it worked fine. (Just noting it here incase it's helpful to others)

#include "freetype2/freetype/freetype.h"
#include "freetype2/freetype/ftglyph.h"
#include "freetype2/freetype/ftoutln.h"
#include "freetype2/freetype/fttrigon.h"

filename_ = linuxFontPathByName(fontname); (in .cpp , line 540)

Hi there,
I fail to compile a project in OF 0.8.4 and the compilation error is that the above was not declared in this scope.
I have included the addon in the addon.make file, but when I open the project it does not appear under the "addons" folders and it cannot compile.
this function can not be foudn in any of the #includes.
What is going on?

thank you!

convert function convToUCS4 called twice.

はじめまして。

Mac OS X 10.7.5 で利用していますが、
stringWidth(wstring s)メンバ関数 の結果がどうもおかしいので、調べた所、
当方の環境ではllvmマクロとclangマクロが定義されているのですが、
stringWidth(wstring s)メンバ関数 ofxTrueTypeFontUC.cpp 575行目で
一度 util::ofxTrueTypeFontUC::convToUCS4<wchar_t> で変換され、
その後getStringBoundingBox内で再度全く同じように変換されていることが原因のようですので
報告します。

stringWidth(wstring s)メンバ関数のほうの変換をコメントアウトしたところ問題なくなりました。

環境依存の問題で上手く再現しないかもしれませんがよろしくお願いします。

getStringMesh() and getFontTexture()

ofTrueTypeFont provides these two functions for caching string in draw phase:

ofTrueTypeFont font;
// load fonts...

ofVboMesh mesh;

void update()
{
    if (needs_update) {
        std::string const str = some_updated_string();
        mesh = font.getStringMesh(str, 0, 0);
    }
}

void draw()
{
    font.getFontTexture().bind();
    mesh.draw();
    font.getFontTexture().unbind();
}

So is there any way to provide this in ofxTrueTypeFontUC?
I know it's a bit tricky since the texture in ofxTrueTypeFontUC is divided into each chars, but in ofTrueTypeFont, is not (which is concatenated, I think).

font not included in example.

Hi! @hironishihara Great work on this, was wondering if you could include the font that works with the example...I just tried a random font, didn't work with the japanese characters, maybe I am doing something wrong.

I am in the process of making ofxUI's font renderer swappable and ofxTrueTypeFontUC would be insanely helpful! Thanks for the help in advanced!

Not working in OpenGL 4.0

Hi,hironishihara. I found when i set the GLVersion in 4.0.

int main() {
ofGLWindowSettings settings;
settings.setGLVersion(4, 0);

settings.width = 1920;
settings.height = 1080;

ofCreateWindow(settings);
ofRunApp(new ofApp());

}

The font can't show correct.It became many pieces of rectangle.
And when i use " ofTrueTypeFont " instead "ofxTrueTypeFontUC" to show the English font.It can work in OpenGL 4.0 ~ Is there any suggestion make ofxTrueTypeFontUC working in OpenGL 4.0?

Bad font resolution in Windows

Hi, thanks for this addon, I've been using it for some time. But recently I´m getting a very bad font rendering, text looks like in a very low resolution image. I've tried to change font DPI, change font files, no difference, can´t get it to render properly. I'm using Windows 10, OF 0.9.8. Any hints on what could be the problem?

Call to implicitly-deleted copy constructor of "my object"

Hi
Nice addon, actually it works well on of 0.9.8. I'm having a strange issue when I call ofxTrueTypeFontUC inside an object. It appears "Call to implicitly-deleted copy constructor of "my object"" but it only appears when I add ofxTrueTypeFontUC myFont; inside myObject.h.
Have you seen something similar before?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.