diff --git a/dub.json b/dub.json index 32f6d1f..e91aa02 100644 --- a/dub.json +++ b/dub.json @@ -59,8 +59,8 @@ "name": "email", "description": "Email helper library, both sending MIME messages and parsing incoming mbox/maildir messages", "targetType": "sourceLibrary", - "dependencies": {"arsd-official:dom":"*"}, - "sourceFiles": ["email.d", "htmltotext.d"] + "dependencies": {"arsd-official:htmltotext":"*"}, + "sourceFiles": ["email.d"] }, { @@ -70,6 +70,14 @@ "dependencies": {"arsd-official:color_base":"*"}, "sourceFiles": ["image.d", "png.d", "bmp.d", "jpeg.d", "targa.d", "pcx.d", "dds.d"] }, + { + "name": "htmltotext", + "description": "HTML to plain text conversion", + "targetType": "sourceLibrary", + "dependencies": {"arsd-official:dom":"*", "arsd-official:color_base":"*"}, + "sourceFiles": ["htmltotext.d"] + + }, { "name": "dom", "description": "HTML tag soup DOM library", diff --git a/nanovega.d b/nanovega.d index 921cf55..5a51e70 100644 --- a/nanovega.d +++ b/nanovega.d @@ -1281,6 +1281,8 @@ public enum NVGImageFlag : uint { RepeatY = 1<<2, /// Repeat image in Y direction. FlipY = 1<<3, /// Flips (inverses) image in Y direction when rendered. Premultiplied = 1<<4, /// Image data has premultiplied alpha. + ClampToBorderX = 1<<5, /// Clamp image to border (instead of clamping to edge by default) + ClampToBorderY = 1<<6, /// Clamp image to border (instead of clamping to edge by default) NoFiltering = 1<<8, /// use GL_NEAREST instead of GL_LINEAR Nearest = NoFiltering, /// compatibility with original NanoVG NoDelete = 1<<16,/// Do not delete GL texture handle. @@ -13405,8 +13407,23 @@ int glnvg__renderCreateTexture (void* uptr, NVGtexture type, int w, int h, int i glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MIN_FILTER, tfmin); glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_MAG_FILTER, (imageFlags&NVGImageFlag.NoFiltering ? GL_NEAREST : GL_LINEAR)); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, (imageFlags&NVGImageFlag.RepeatX ? GL_REPEAT : GL_CLAMP_TO_EDGE)); - glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, (imageFlags&NVGImageFlag.RepeatY ? GL_REPEAT : GL_CLAMP_TO_EDGE)); + int flag; + if (imageFlags&NVGImageFlag.RepeatX) + flag = GL_REPEAT; + else if (imageFlags&NVGImageFlag.ClampToBorderX) + flag = GL_CLAMP_TO_BORDER; + else + flag = GL_CLAMP_TO_EDGE; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_S, flag); + + + if (imageFlags&NVGImageFlag.RepeatY) + flag = GL_REPEAT; + else if (imageFlags&NVGImageFlag.ClampToBorderY) + flag = GL_CLAMP_TO_BORDER; + else + flag = GL_CLAMP_TO_EDGE; + glTexParameteri(GL_TEXTURE_2D, GL_TEXTURE_WRAP_T, flag); glPixelStorei(GL_UNPACK_ALIGNMENT, 4); glPixelStorei(GL_UNPACK_ROW_LENGTH, 0); diff --git a/simpledisplay.d b/simpledisplay.d index 55ce7b8..62f66fa 100644 --- a/simpledisplay.d +++ b/simpledisplay.d @@ -12630,6 +12630,7 @@ extern(System) nothrow @nogc { enum uint GL_REPEAT = 0x2901; enum uint GL_CLAMP = 0x2900; enum uint GL_CLAMP_TO_EDGE = 0x812F; + enum uint GL_CLAMP_TO_BORDER = 0x812D; enum uint GL_DECAL = 0x2101; enum uint GL_MODULATE = 0x2100; enum uint GL_TEXTURE_ENV = 0x2300; diff --git a/ttf.d b/ttf.d index 7b23b8c..ff13d45 100644 --- a/ttf.d +++ b/ttf.d @@ -1040,7 +1040,6 @@ private stbtt_uint32 stbtt__cff_int(stbtt__buf *b) else if (b0 == 28) return stbtt__buf_get16(b); else if (b0 == 29) return stbtt__buf_get32(b); assert(0); - return 0; } private void stbtt__cff_skip_operand(stbtt__buf *b) { @@ -1343,7 +1342,6 @@ public int stbtt_FindGlyphIndex(const(stbtt_fontinfo)* info, int unicode_codepoi return 0; } else if (format == 2) { assert(0); // @TODO: high-byte mapping for japanese/chinese/korean - return 0; } else if (format == 4) { // standard mapping for windows fonts: binary search collection of ranges stbtt_uint16 segcount = ttUSHORT(data+index_map+6) >> 1; stbtt_uint16 searchRange = ttUSHORT(data+index_map+8) >> 1; @@ -1414,7 +1412,6 @@ public int stbtt_FindGlyphIndex(const(stbtt_fontinfo)* info, int unicode_codepoi } // @TODO assert(0); - return 0; } public int stbtt_GetCodepointShape(stbtt_fontinfo* info, int unicode_codepoint, stbtt_vertex **vertices) @@ -2231,7 +2228,7 @@ private stbtt_int32 stbtt__GetCoverageIndex(stbtt_uint8 *coverageTable, int gly default: { // There are no other cases. assert(0); - } break; + } } return -1; @@ -2280,7 +2277,7 @@ private stbtt_int32 stbtt__GetGlyphClass(stbtt_uint8 *classDefTable, int glyph) default: { // There are no other cases. assert(0); - } break; + } } return -1; @@ -2400,7 +2397,6 @@ private stbtt_int32 stbtt__GetGlyphGPOSInfoAdvance(stbtt_fontinfo* info, int gl default: { // There are no other cases. assert(0); - break; } } }