{"action":"created","comment":{"url":"https://api.github.com/repos/tangrams/tangram-es/pulls/comments/56523187","id":56523187,"diff_hunk":"@@ -34,39 +37,66 @@ class TextStyle : public Style {\n         TextLabelProperty::Align align = TextLabelProperty::Align::center;\n         LabelProperty::Anchor anchor = LabelProperty::Anchor::center;\n \n-        bool isValid() {\n-            return fontSize > 0.f && !text.empty();\n-        }\n+        float fontScale = 1;\n+        float lineSpacing = 0;\n     };\n \n-    TextStyle(std::string _name, std::shared_ptr<FontContext> _fontContext,\n-              bool _sdf = false, bool _sdfMultisampling = false,\n-              Blending _blendMode = Blending::overlay,\n-              GLenum _drawMode = GL_TRIANGLES);\n-\n-    virtual void onBeginDrawFrame(const View& _view, Scene& _scene) override;\n-\n-    virtual ~TextStyle();\n-\n-    bool useSDF() const { return m_sdf; }\n-    auto& fontContext() const { return *m_fontContext; }\n+    auto& context() const { return m_context; }\n \n protected:\n \n-    virtual void constructVertexLayout() override;\n-    virtual void constructShaderProgram() override;\n+    void constructVertexLayout() override;\n+    void constructShaderProgram() override;\n \n-    virtual std::unique_ptr<StyleBuilder> createBuilder() const override;\n+    std::unique_ptr<StyleBuilder> createBuilder() const override;\n \n     bool m_sdf;\n-    bool m_sdfMultisampling;\n \n-    std::shared_ptr<FontContext> m_fontContext;\n+    std::shared_ptr<FontContext> m_context;\n \n-    UniformLocation m_uOrtho{\"u_ortho\"};\n-    UniformLocation m_uTex{\"u_tex\"};\n     UniformLocation m_uTexScaleFactor{\"u_uv_scale_factor\"};\n-    \n+    UniformLocation m_uTex{\"u_tex\"};\n+    UniformLocation m_uOrtho{\"u_ortho\"};\n+    UniformLocation m_uPass{\"u_pass\"};\n+    UniformLocation m_uMaxStrokeWidth{\"u_max_stroke_width\"};\n+\n+    mutable std::vector<std::unique_ptr<DynamicQuadMesh>> m_meshes;\n+\n+public:\n+\n+    TextStyle(std::string _name, bool _sdf = false,\n+              Blending _blendMode = Blending::overlay,\n+              GLenum _drawMode = GL_TRIANGLES);\n+\n+    /* Create the LabelMeshes associated with FontContext GlyphTexture<s>\n+     * No GL involved, called from Tangram::update()\n+     */\n+    void onBeginUpdate() override;\n+\n+    /* Upload the buffers of the text batches\n+     * Upload the textur atlases\n+     */\n+    void onBeginFrame() override;\n+\n+    /* Performs the actual drawing of the meshes in two passes\n+     * - First pass if signed distance field is on, draw outlines\n+     * - Second pass, draw the inner glyph pixels\n+     */\n+    void onBeginDrawFrame(const View& _view, Scene& _scene) override;\n+\n+    DynamicQuadMesh& getMesh(size_t id) const {\n+        if (id >= m_meshes.size()) {","path":"core/src/style/textStyle.h","position":112,"original_position":112,"commit_id":"0153a4cac029418be08702118fbe0db9b53f2117","original_commit_id":"05566bb05ac1a3d4ab67f7f0c26c4274b32de3c8","user":{"login":"karimnaaji","id":7061573,"avatar_url":"https://avatars.githubusercontent.com/u/7061573?v=3","gravatar_id":"","url":"https://api.github.com/users/karimnaaji","html_url":"https://github.com/karimnaaji","followers_url":"https://api.github.com/users/karimnaaji/followers","following_url":"https://api.github.com/users/karimnaaji/following{/other_user}","gists_url":"https://api.github.com/users/karimnaaji/gists{/gist_id}","starred_url":"https://api.github.com/users/karimnaaji/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/karimnaaji/subscriptions","organizations_url":"https://api.github.com/users/karimnaaji/orgs","repos_url":"https://api.github.com/users/karimnaaji/repos","events_url":"https://api.github.com/users/karimnaaji/events{/privacy}","received_events_url":"https://api.github.com/users/karimnaaji/received_events","type":"User","site_admin":false},"body":"It shouldn't, it's just for sanity. Here I think that this should return a pointer instead. Otherwise the ref is a bad reference.","created_at":"2016-03-17T15:29:12Z","updated_at":"2016-03-17T15:29:12Z","html_url":"https://github.com/tangrams/tangram-es/pull/561#discussion_r56523187","pull_request_url":"https://api.github.com/repos/tangrams/tangram-es/pulls/561","_links":{"self":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/comments/56523187"},"html":{"href":"https://github.com/tangrams/tangram-es/pull/561#discussion_r56523187"},"pull_request":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/561"}}},"pull_request":{"url":"https://api.github.com/repos/tangrams/tangram-es/pulls/561","id":60217607,"html_url":"https://github.com/tangrams/tangram-es/pull/561","diff_url":"https://github.com/tangrams/tangram-es/pull/561.diff","patch_url":"https://github.com/tangrams/tangram-es/pull/561.patch","issue_url":"https://api.github.com/repos/tangrams/tangram-es/issues/561","number":561,"state":"open","locked":false,"title":"alfons","user":{"login":"hjanetzek","id":1747,"avatar_url":"https://avatars.githubusercontent.com/u/1747?v=3","gravatar_id":"","url":"https://api.github.com/users/hjanetzek","html_url":"https://github.com/hjanetzek","followers_url":"https://api.github.com/users/hjanetzek/followers","following_url":"https://api.github.com/users/hjanetzek/following{/other_user}","gists_url":"https://api.github.com/users/hjanetzek/gists{/gist_id}","starred_url":"https://api.github.com/users/hjanetzek/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/hjanetzek/subscriptions","organizations_url":"https://api.github.com/users/hjanetzek/orgs","repos_url":"https://api.github.com/users/hjanetzek/repos","events_url":"https://api.github.com/users/hjanetzek/events{/privacy}","received_events_url":"https://api.github.com/users/hjanetzek/received_events","type":"User","site_admin":false},"body":"continuing #506 ","created_at":"2016-02-22T18:25:46Z","updated_at":"2016-03-17T15:29:12Z","closed_at":null,"merged_at":null,"merge_commit_sha":"76fbfd4806eb12a4b24e2d6cb0e5922d7ea03b78","assignee":null,"milestone":null,"commits_url":"https://api.github.com/repos/tangrams/tangram-es/pulls/561/commits","review_comments_url":"https://api.github.com/repos/tangrams/tangram-es/pulls/561/comments","review_comment_url":"https://api.github.com/repos/tangrams/tangram-es/pulls/comments{/number}","comments_url":"https://api.github.com/repos/tangrams/tangram-es/issues/561/comments","statuses_url":"https://api.github.com/repos/tangrams/tangram-es/statuses/0153a4cac029418be08702118fbe0db9b53f2117","head":{"label":"tangrams:rb-alfons","ref":"rb-alfons","sha":"0153a4cac029418be08702118fbe0db9b53f2117","user":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"repo":{"id":23391501,"name":"tangram-es","full_name":"tangrams/tangram-es","owner":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tangrams/tangram-es","description":"2D and 3D map renderer using OpenGL ES","fork":false,"url":"https://api.github.com/repos/tangrams/tangram-es","forks_url":"https://api.github.com/repos/tangrams/tangram-es/forks","keys_url":"https://api.github.com/repos/tangrams/tangram-es/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tangrams/tangram-es/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tangrams/tangram-es/teams","hooks_url":"https://api.github.com/repos/tangrams/tangram-es/hooks","issue_events_url":"https://api.github.com/repos/tangrams/tangram-es/issues/events{/number}","events_url":"https://api.github.com/repos/tangrams/tangram-es/events","assignees_url":"https://api.github.com/repos/tangrams/tangram-es/assignees{/user}","branches_url":"https://api.github.com/repos/tangrams/tangram-es/branches{/branch}","tags_url":"https://api.github.com/repos/tangrams/tangram-es/tags","blobs_url":"https://api.github.com/repos/tangrams/tangram-es/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tangrams/tangram-es/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tangrams/tangram-es/git/refs{/sha}","trees_url":"https://api.github.com/repos/tangrams/tangram-es/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tangrams/tangram-es/statuses/{sha}","languages_url":"https://api.github.com/repos/tangrams/tangram-es/languages","stargazers_url":"https://api.github.com/repos/tangrams/tangram-es/stargazers","contributors_url":"https://api.github.com/repos/tangrams/tangram-es/contributors","subscribers_url":"https://api.github.com/repos/tangrams/tangram-es/subscribers","subscription_url":"https://api.github.com/repos/tangrams/tangram-es/subscription","commits_url":"https://api.github.com/repos/tangrams/tangram-es/commits{/sha}","git_commits_url":"https://api.github.com/repos/tangrams/tangram-es/git/commits{/sha}","comments_url":"https://api.github.com/repos/tangrams/tangram-es/comments{/number}","issue_comment_url":"https://api.github.com/repos/tangrams/tangram-es/issues/comments{/number}","contents_url":"https://api.github.com/repos/tangrams/tangram-es/contents/{+path}","compare_url":"https://api.github.com/repos/tangrams/tangram-es/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tangrams/tangram-es/merges","archive_url":"https://api.github.com/repos/tangrams/tangram-es/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tangrams/tangram-es/downloads","issues_url":"https://api.github.com/repos/tangrams/tangram-es/issues{/number}","pulls_url":"https://api.github.com/repos/tangrams/tangram-es/pulls{/number}","milestones_url":"https://api.github.com/repos/tangrams/tangram-es/milestones{/number}","notifications_url":"https://api.github.com/repos/tangrams/tangram-es/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tangrams/tangram-es/labels{/name}","releases_url":"https://api.github.com/repos/tangrams/tangram-es/releases{/id}","deployments_url":"https://api.github.com/repos/tangrams/tangram-es/deployments","created_at":"2014-08-27T13:56:56Z","updated_at":"2016-03-17T09:09:13Z","pushed_at":"2016-03-17T15:22:51Z","git_url":"git://github.com/tangrams/tangram-es.git","ssh_url":"git@github.com:tangrams/tangram-es.git","clone_url":"https://github.com/tangrams/tangram-es.git","svn_url":"https://github.com/tangrams/tangram-es","homepage":"","size":35840,"stargazers_count":90,"watchers_count":90,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":58,"forks":31,"open_issues":58,"watchers":90,"default_branch":"master"}},"base":{"label":"tangrams:master","ref":"master","sha":"be769847b080812102257ad84840e035c9f16f10","user":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"repo":{"id":23391501,"name":"tangram-es","full_name":"tangrams/tangram-es","owner":{"login":"tangrams","id":8495302,"avatar_url":"https://avatars.githubusercontent.com/u/8495302?v=3","gravatar_id":"","url":"https://api.github.com/users/tangrams","html_url":"https://github.com/tangrams","followers_url":"https://api.github.com/users/tangrams/followers","following_url":"https://api.github.com/users/tangrams/following{/other_user}","gists_url":"https://api.github.com/users/tangrams/gists{/gist_id}","starred_url":"https://api.github.com/users/tangrams/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/tangrams/subscriptions","organizations_url":"https://api.github.com/users/tangrams/orgs","repos_url":"https://api.github.com/users/tangrams/repos","events_url":"https://api.github.com/users/tangrams/events{/privacy}","received_events_url":"https://api.github.com/users/tangrams/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/tangrams/tangram-es","description":"2D and 3D map renderer using OpenGL ES","fork":false,"url":"https://api.github.com/repos/tangrams/tangram-es","forks_url":"https://api.github.com/repos/tangrams/tangram-es/forks","keys_url":"https://api.github.com/repos/tangrams/tangram-es/keys{/key_id}","collaborators_url":"https://api.github.com/repos/tangrams/tangram-es/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/tangrams/tangram-es/teams","hooks_url":"https://api.github.com/repos/tangrams/tangram-es/hooks","issue_events_url":"https://api.github.com/repos/tangrams/tangram-es/issues/events{/number}","events_url":"https://api.github.com/repos/tangrams/tangram-es/events","assignees_url":"https://api.github.com/repos/tangrams/tangram-es/assignees{/user}","branches_url":"https://api.github.com/repos/tangrams/tangram-es/branches{/branch}","tags_url":"https://api.github.com/repos/tangrams/tangram-es/tags","blobs_url":"https://api.github.com/repos/tangrams/tangram-es/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/tangrams/tangram-es/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/tangrams/tangram-es/git/refs{/sha}","trees_url":"https://api.github.com/repos/tangrams/tangram-es/git/trees{/sha}","statuses_url":"https://api.github.com/repos/tangrams/tangram-es/statuses/{sha}","languages_url":"https://api.github.com/repos/tangrams/tangram-es/languages","stargazers_url":"https://api.github.com/repos/tangrams/tangram-es/stargazers","contributors_url":"https://api.github.com/repos/tangrams/tangram-es/contributors","subscribers_url":"https://api.github.com/repos/tangrams/tangram-es/subscribers","subscription_url":"https://api.github.com/repos/tangrams/tangram-es/subscription","commits_url":"https://api.github.com/repos/tangrams/tangram-es/commits{/sha}","git_commits_url":"https://api.github.com/repos/tangrams/tangram-es/git/commits{/sha}","comments_url":"https://api.github.com/repos/tangrams/tangram-es/comments{/number}","issue_comment_url":"https://api.github.com/repos/tangrams/tangram-es/issues/comments{/number}","contents_url":"https://api.github.com/repos/tangrams/tangram-es/contents/{+path}","compare_url":"https://api.github.com/repos/tangrams/tangram-es/compare/{base}...{head}","merges_url":"https://api.github.com/repos/tangrams/tangram-es/merges","archive_url":"https://api.github.com/repos/tangrams/tangram-es/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/tangrams/tangram-es/downloads","issues_url":"https://api.github.com/repos/tangrams/tangram-es/issues{/number}","pulls_url":"https://api.github.com/repos/tangrams/tangram-es/pulls{/number}","milestones_url":"https://api.github.com/repos/tangrams/tangram-es/milestones{/number}","notifications_url":"https://api.github.com/repos/tangrams/tangram-es/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/tangrams/tangram-es/labels{/name}","releases_url":"https://api.github.com/repos/tangrams/tangram-es/releases{/id}","deployments_url":"https://api.github.com/repos/tangrams/tangram-es/deployments","created_at":"2014-08-27T13:56:56Z","updated_at":"2016-03-17T09:09:13Z","pushed_at":"2016-03-17T15:22:51Z","git_url":"git://github.com/tangrams/tangram-es.git","ssh_url":"git@github.com:tangrams/tangram-es.git","clone_url":"https://github.com/tangrams/tangram-es.git","svn_url":"https://github.com/tangrams/tangram-es","homepage":"","size":35840,"stargazers_count":90,"watchers_count":90,"language":"C++","has_issues":true,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":31,"mirror_url":null,"open_issues_count":58,"forks":31,"open_issues":58,"watchers":90,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/561"},"html":{"href":"https://github.com/tangrams/tangram-es/pull/561"},"issue":{"href":"https://api.github.com/repos/tangrams/tangram-es/issues/561"},"comments":{"href":"https://api.github.com/repos/tangrams/tangram-es/issues/561/comments"},"review_comments":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/561/comments"},"review_comment":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/tangrams/tangram-es/pulls/561/commits"},"statuses":{"href":"https://api.github.com/repos/tangrams/tangram-es/statuses/0153a4cac029418be08702118fbe0db9b53f2117"}}}}