{"action":"created","comment":{"url":"https://api.github.com/repos/geotools/geotools/pulls/comments/85783566","pull_request_review_id":6478353,"id":85783566,"diff_hunk":"@@ -605,27 +661,113 @@ public void paintCurvedLabel(LineStringCursor cursor) {\n                     cursor.moveTo(cursor.getCurrentOrdinate() + advance + nextAdvance);\n                 }\n \n-                // draw halo and label\n-                if (labelItem.getTextStyle().getHaloFill() != null) {\n-                    configureHalo();\n-                    for (int i = 0; i < numGlyphs; i++) {\n-                        graphics.setTransform(transforms[i]);\n-                        graphics.draw(outlines[i]);\n-                    }\n-                }\n-                configureLabelStyle();\n-                for (int i = 0; i < numGlyphs; i++) {\n-                    graphics.setTransform(transforms[i]);\n-                    graphics.fill(outlines[i]);\n-                }\n+                allOutlines.add(outlines);\n+                allTransforms.add(transforms);\n \n                 // take into account eventual spaces at the end of the glyph\n                 cursor.moveTo(start + glyphVector.getGlyphPosition(numGlyphs).getX());\n+            }\n+\n+            // draw halo and label\n+            if (labelItem.getTextStyle().getHaloFill() != null) {\n+                configureHalo();\n+                if (labelItem.isTextUnderlineEnabled()) {\n+                    // we need to draw the underline halo\n+                    drawCurvedUnderline(line, cursor, startOrdinate, true);\n+                }\n+                drawOrFillOutlines(allOutlines, allTransforms, false);\n+            }\n+            graphics.setTransform(oldTransform);\n+            configureLabelStyle();\n+            if (labelItem.isTextUnderlineEnabled()) {\n+                // we need to draw the underline\n+                drawCurvedUnderline(line, cursor, startOrdinate, false);\n+            }\n+            drawOrFillOutlines(allOutlines, allTransforms, true);\n+        } finally {\n+            graphics.setTransform(oldTransform);\n+        }\n+    }\n+\n+    /**\n+     * Helper method that will draw the underline of a curved label using the context of the cursor.\n+     */\n+    private void drawCurvedUnderline(LineInfo line, LineStringCursor cursor, double startOrdinate, boolean drawingHalo) {\n+        // extracting label first line component and compute is metrics\n+        LineComponent component = line.getComponents().get(0);\n+        LineMetrics metrics = computeLineMetricsIfNeeded(component);\n+        // the cursor is in the last char of the label\n+        double endOrdinate = cursor.getCurrentOrdinate();\n+        // compute the advance based on the first char of the label\n+        GlyphVector glyphVector = line.getComponents().get(0).getGlyphVector();\n+        double advance = glyphVector.getGlyphMetrics(0).getAdvance() * 0.5f;\n+        // extract from the linestring the portion associated with the layer\n+        LineString labelLineString = cursor.getSubLineString(startOrdinate - advance, endOrdinate - advance);\n+        // compute the underline linestring\n+        LiteShape underlineLineString = computeCurvedUnderline(labelLineString, metrics);\n+        if (drawingHalo) {\n+            // draw the underline halo\n+            graphics.draw(underlineLineString);","path":"modules/library/render/src/main/java/org/geotools/renderer/label/LabelPainter.java","position":228,"original_position":228,"commit_id":"7d61e6558b41aa5f4091460bf286731e09ba6cdf","original_commit_id":"7d61e6558b41aa5f4091460bf286731e09ba6cdf","user":{"login":"nmco","id":1590542,"avatar_url":"https://avatars.githubusercontent.com/u/1590542?v=3","gravatar_id":"","url":"https://api.github.com/users/nmco","html_url":"https://github.com/nmco","followers_url":"https://api.github.com/users/nmco/followers","following_url":"https://api.github.com/users/nmco/following{/other_user}","gists_url":"https://api.github.com/users/nmco/gists{/gist_id}","starred_url":"https://api.github.com/users/nmco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmco/subscriptions","organizations_url":"https://api.github.com/users/nmco/orgs","repos_url":"https://api.github.com/users/nmco/repos","events_url":"https://api.github.com/users/nmco/events{/privacy}","received_events_url":"https://api.github.com/users/nmco/received_events","type":"User","site_admin":false},"body":"Regarding the second question:\r\nThis is my fault, the original underline looked very thin so I perform some tests doubling the original thickness:\r\n```\r\ngraphics.setStroke(new BasicStroke(metrics.getUnderlineThickness() * 2));\r\n```","created_at":"2016-10-31T16:59:31Z","updated_at":"2016-10-31T16:59:31Z","html_url":"https://github.com/geotools/geotools/pull/1371#discussion_r85783566","pull_request_url":"https://api.github.com/repos/geotools/geotools/pulls/1371","_links":{"self":{"href":"https://api.github.com/repos/geotools/geotools/pulls/comments/85783566"},"html":{"href":"https://github.com/geotools/geotools/pull/1371#discussion_r85783566"},"pull_request":{"href":"https://api.github.com/repos/geotools/geotools/pulls/1371"}}},"pull_request":{"url":"https://api.github.com/repos/geotools/geotools/pulls/1371","id":91596901,"html_url":"https://github.com/geotools/geotools/pull/1371","diff_url":"https://github.com/geotools/geotools/pull/1371.diff","patch_url":"https://github.com/geotools/geotools/pull/1371.patch","issue_url":"https://api.github.com/repos/geotools/geotools/issues/1371","number":1371,"state":"open","locked":false,"title":"[GEOT-5561] Add an SLD vendor option to underline labels","user":{"login":"nmco","id":1590542,"avatar_url":"https://avatars.githubusercontent.com/u/1590542?v=3","gravatar_id":"","url":"https://api.github.com/users/nmco","html_url":"https://github.com/nmco","followers_url":"https://api.github.com/users/nmco/followers","following_url":"https://api.github.com/users/nmco/following{/other_user}","gists_url":"https://api.github.com/users/nmco/gists{/gist_id}","starred_url":"https://api.github.com/users/nmco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmco/subscriptions","organizations_url":"https://api.github.com/users/nmco/orgs","repos_url":"https://api.github.com/users/nmco/repos","events_url":"https://api.github.com/users/nmco/events{/privacy}","received_events_url":"https://api.github.com/users/nmco/received_events","type":"User","site_admin":false},"body":"This pull request adds a ``underlineText`` vendor option that will instruct the renderer to underline labels. The underline will work like a typical word processor text underline. The thickness and position of the underline will be defined by the font and color will be the same as the text. Spaces will also be underlined.\r\n\r\nNote that CSS and YSLD modules have also been updated to take in account this new vendor option.\r\n\r\nTo see the expected result we can check the GeoServer documentation pull request:\r\nhttps://github.com/geoserver/geoserver/pull/1934\r\n\r\nAssociated issue:\r\nhttps://osgeo-org.atlassian.net/browse/GEOT-5561\r\n","created_at":"2016-10-31T11:55:41Z","updated_at":"2016-10-31T16:59:31Z","closed_at":null,"merged_at":null,"merge_commit_sha":"6fc6c63ed93965ace9275f18f17e3544738bc91b","assignee":null,"assignees":[],"milestone":null,"commits_url":"https://api.github.com/repos/geotools/geotools/pulls/1371/commits","review_comments_url":"https://api.github.com/repos/geotools/geotools/pulls/1371/comments","review_comment_url":"https://api.github.com/repos/geotools/geotools/pulls/comments{/number}","comments_url":"https://api.github.com/repos/geotools/geotools/issues/1371/comments","statuses_url":"https://api.github.com/repos/geotools/geotools/statuses/7d61e6558b41aa5f4091460bf286731e09ba6cdf","head":{"label":"nmco:underline-code-2","ref":"underline-code-2","sha":"7d61e6558b41aa5f4091460bf286731e09ba6cdf","user":{"login":"nmco","id":1590542,"avatar_url":"https://avatars.githubusercontent.com/u/1590542?v=3","gravatar_id":"","url":"https://api.github.com/users/nmco","html_url":"https://github.com/nmco","followers_url":"https://api.github.com/users/nmco/followers","following_url":"https://api.github.com/users/nmco/following{/other_user}","gists_url":"https://api.github.com/users/nmco/gists{/gist_id}","starred_url":"https://api.github.com/users/nmco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmco/subscriptions","organizations_url":"https://api.github.com/users/nmco/orgs","repos_url":"https://api.github.com/users/nmco/repos","events_url":"https://api.github.com/users/nmco/events{/privacy}","received_events_url":"https://api.github.com/users/nmco/received_events","type":"User","site_admin":false},"repo":{"id":17440699,"name":"geotools","full_name":"nmco/geotools","owner":{"login":"nmco","id":1590542,"avatar_url":"https://avatars.githubusercontent.com/u/1590542?v=3","gravatar_id":"","url":"https://api.github.com/users/nmco","html_url":"https://github.com/nmco","followers_url":"https://api.github.com/users/nmco/followers","following_url":"https://api.github.com/users/nmco/following{/other_user}","gists_url":"https://api.github.com/users/nmco/gists{/gist_id}","starred_url":"https://api.github.com/users/nmco/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/nmco/subscriptions","organizations_url":"https://api.github.com/users/nmco/orgs","repos_url":"https://api.github.com/users/nmco/repos","events_url":"https://api.github.com/users/nmco/events{/privacy}","received_events_url":"https://api.github.com/users/nmco/received_events","type":"User","site_admin":false},"private":false,"html_url":"https://github.com/nmco/geotools","description":"Official GeoTools repository","fork":true,"url":"https://api.github.com/repos/nmco/geotools","forks_url":"https://api.github.com/repos/nmco/geotools/forks","keys_url":"https://api.github.com/repos/nmco/geotools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/nmco/geotools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/nmco/geotools/teams","hooks_url":"https://api.github.com/repos/nmco/geotools/hooks","issue_events_url":"https://api.github.com/repos/nmco/geotools/issues/events{/number}","events_url":"https://api.github.com/repos/nmco/geotools/events","assignees_url":"https://api.github.com/repos/nmco/geotools/assignees{/user}","branches_url":"https://api.github.com/repos/nmco/geotools/branches{/branch}","tags_url":"https://api.github.com/repos/nmco/geotools/tags","blobs_url":"https://api.github.com/repos/nmco/geotools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/nmco/geotools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/nmco/geotools/git/refs{/sha}","trees_url":"https://api.github.com/repos/nmco/geotools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/nmco/geotools/statuses/{sha}","languages_url":"https://api.github.com/repos/nmco/geotools/languages","stargazers_url":"https://api.github.com/repos/nmco/geotools/stargazers","contributors_url":"https://api.github.com/repos/nmco/geotools/contributors","subscribers_url":"https://api.github.com/repos/nmco/geotools/subscribers","subscription_url":"https://api.github.com/repos/nmco/geotools/subscription","commits_url":"https://api.github.com/repos/nmco/geotools/commits{/sha}","git_commits_url":"https://api.github.com/repos/nmco/geotools/git/commits{/sha}","comments_url":"https://api.github.com/repos/nmco/geotools/comments{/number}","issue_comment_url":"https://api.github.com/repos/nmco/geotools/issues/comments{/number}","contents_url":"https://api.github.com/repos/nmco/geotools/contents/{+path}","compare_url":"https://api.github.com/repos/nmco/geotools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/nmco/geotools/merges","archive_url":"https://api.github.com/repos/nmco/geotools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/nmco/geotools/downloads","issues_url":"https://api.github.com/repos/nmco/geotools/issues{/number}","pulls_url":"https://api.github.com/repos/nmco/geotools/pulls{/number}","milestones_url":"https://api.github.com/repos/nmco/geotools/milestones{/number}","notifications_url":"https://api.github.com/repos/nmco/geotools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/nmco/geotools/labels{/name}","releases_url":"https://api.github.com/repos/nmco/geotools/releases{/id}","deployments_url":"https://api.github.com/repos/nmco/geotools/deployments","created_at":"2014-03-05T12:55:46Z","updated_at":"2016-01-15T12:03:46Z","pushed_at":"2016-10-31T11:47:06Z","git_url":"git://github.com/nmco/geotools.git","ssh_url":"git@github.com:nmco/geotools.git","clone_url":"https://github.com/nmco/geotools.git","svn_url":"https://github.com/nmco/geotools","homepage":"http://geotools.org","size":129840,"stargazers_count":0,"watchers_count":0,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":0,"mirror_url":null,"open_issues_count":0,"forks":0,"open_issues":0,"watchers":0,"default_branch":"master"}},"base":{"label":"geotools:master","ref":"master","sha":"ca4a3d1ec9409e6ccb1dbe45859ad202b6a7e2f6","user":{"login":"geotools","id":1187031,"avatar_url":"https://avatars.githubusercontent.com/u/1187031?v=3","gravatar_id":"","url":"https://api.github.com/users/geotools","html_url":"https://github.com/geotools","followers_url":"https://api.github.com/users/geotools/followers","following_url":"https://api.github.com/users/geotools/following{/other_user}","gists_url":"https://api.github.com/users/geotools/gists{/gist_id}","starred_url":"https://api.github.com/users/geotools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geotools/subscriptions","organizations_url":"https://api.github.com/users/geotools/orgs","repos_url":"https://api.github.com/users/geotools/repos","events_url":"https://api.github.com/users/geotools/events{/privacy}","received_events_url":"https://api.github.com/users/geotools/received_events","type":"Organization","site_admin":false},"repo":{"id":2752522,"name":"geotools","full_name":"geotools/geotools","owner":{"login":"geotools","id":1187031,"avatar_url":"https://avatars.githubusercontent.com/u/1187031?v=3","gravatar_id":"","url":"https://api.github.com/users/geotools","html_url":"https://github.com/geotools","followers_url":"https://api.github.com/users/geotools/followers","following_url":"https://api.github.com/users/geotools/following{/other_user}","gists_url":"https://api.github.com/users/geotools/gists{/gist_id}","starred_url":"https://api.github.com/users/geotools/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/geotools/subscriptions","organizations_url":"https://api.github.com/users/geotools/orgs","repos_url":"https://api.github.com/users/geotools/repos","events_url":"https://api.github.com/users/geotools/events{/privacy}","received_events_url":"https://api.github.com/users/geotools/received_events","type":"Organization","site_admin":false},"private":false,"html_url":"https://github.com/geotools/geotools","description":"Official GeoTools repository","fork":false,"url":"https://api.github.com/repos/geotools/geotools","forks_url":"https://api.github.com/repos/geotools/geotools/forks","keys_url":"https://api.github.com/repos/geotools/geotools/keys{/key_id}","collaborators_url":"https://api.github.com/repos/geotools/geotools/collaborators{/collaborator}","teams_url":"https://api.github.com/repos/geotools/geotools/teams","hooks_url":"https://api.github.com/repos/geotools/geotools/hooks","issue_events_url":"https://api.github.com/repos/geotools/geotools/issues/events{/number}","events_url":"https://api.github.com/repos/geotools/geotools/events","assignees_url":"https://api.github.com/repos/geotools/geotools/assignees{/user}","branches_url":"https://api.github.com/repos/geotools/geotools/branches{/branch}","tags_url":"https://api.github.com/repos/geotools/geotools/tags","blobs_url":"https://api.github.com/repos/geotools/geotools/git/blobs{/sha}","git_tags_url":"https://api.github.com/repos/geotools/geotools/git/tags{/sha}","git_refs_url":"https://api.github.com/repos/geotools/geotools/git/refs{/sha}","trees_url":"https://api.github.com/repos/geotools/geotools/git/trees{/sha}","statuses_url":"https://api.github.com/repos/geotools/geotools/statuses/{sha}","languages_url":"https://api.github.com/repos/geotools/geotools/languages","stargazers_url":"https://api.github.com/repos/geotools/geotools/stargazers","contributors_url":"https://api.github.com/repos/geotools/geotools/contributors","subscribers_url":"https://api.github.com/repos/geotools/geotools/subscribers","subscription_url":"https://api.github.com/repos/geotools/geotools/subscription","commits_url":"https://api.github.com/repos/geotools/geotools/commits{/sha}","git_commits_url":"https://api.github.com/repos/geotools/geotools/git/commits{/sha}","comments_url":"https://api.github.com/repos/geotools/geotools/comments{/number}","issue_comment_url":"https://api.github.com/repos/geotools/geotools/issues/comments{/number}","contents_url":"https://api.github.com/repos/geotools/geotools/contents/{+path}","compare_url":"https://api.github.com/repos/geotools/geotools/compare/{base}...{head}","merges_url":"https://api.github.com/repos/geotools/geotools/merges","archive_url":"https://api.github.com/repos/geotools/geotools/{archive_format}{/ref}","downloads_url":"https://api.github.com/repos/geotools/geotools/downloads","issues_url":"https://api.github.com/repos/geotools/geotools/issues{/number}","pulls_url":"https://api.github.com/repos/geotools/geotools/pulls{/number}","milestones_url":"https://api.github.com/repos/geotools/geotools/milestones{/number}","notifications_url":"https://api.github.com/repos/geotools/geotools/notifications{?since,all,participating}","labels_url":"https://api.github.com/repos/geotools/geotools/labels{/name}","releases_url":"https://api.github.com/repos/geotools/geotools/releases{/id}","deployments_url":"https://api.github.com/repos/geotools/geotools/deployments","created_at":"2011-11-10T23:22:12Z","updated_at":"2016-10-27T06:38:42Z","pushed_at":"2016-10-31T11:55:41Z","git_url":"git://github.com/geotools/geotools.git","ssh_url":"git@github.com:geotools/geotools.git","clone_url":"https://github.com/geotools/geotools.git","svn_url":"https://github.com/geotools/geotools","homepage":"http://geotools.org","size":141249,"stargazers_count":340,"watchers_count":340,"language":"Java","has_issues":false,"has_downloads":true,"has_wiki":true,"has_pages":false,"forks_count":468,"mirror_url":null,"open_issues_count":14,"forks":468,"open_issues":14,"watchers":340,"default_branch":"master"}},"_links":{"self":{"href":"https://api.github.com/repos/geotools/geotools/pulls/1371"},"html":{"href":"https://github.com/geotools/geotools/pull/1371"},"issue":{"href":"https://api.github.com/repos/geotools/geotools/issues/1371"},"comments":{"href":"https://api.github.com/repos/geotools/geotools/issues/1371/comments"},"review_comments":{"href":"https://api.github.com/repos/geotools/geotools/pulls/1371/comments"},"review_comment":{"href":"https://api.github.com/repos/geotools/geotools/pulls/comments{/number}"},"commits":{"href":"https://api.github.com/repos/geotools/geotools/pulls/1371/commits"},"statuses":{"href":"https://api.github.com/repos/geotools/geotools/statuses/7d61e6558b41aa5f4091460bf286731e09ba6cdf"}}}}
{"actor":{"display_login":"nmco"}}