# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html
[dependencies]
+narcissus-app = { path = "../../libs/narcissus-app" }
narcissus-core = { path = "../../libs/narcissus-core" }
narcissus-font = { path = "../../libs/narcissus-font" }
narcissus-maths = { path = "../../libs/narcissus-maths" }
narcissus-image = { path = "../../libs/narcissus-image" }
-narcissus-app = { path = "../../libs/narcissus-app" }
narcissus-gpu = { path = "../../libs/narcissus-gpu" }
\ No newline at end of file
}
let mut glyph_instances = Vec::new();
+ let mut line_glyph_indices = Vec::new();
+ let mut line_kern_advances = Vec::new();
let mut align_v = false;
let mut kerning = true;
glyph_instances.clear();
- let mut line_glyph_indices = Vec::new();
- let mut line_kern_advances = Vec::new();
-
for line in 0.. {
let (font_family, font_size_px, text) = if line & 1 == 0 {
(FontFamily::RobotoRegular, 14.0, line0)
layout(location = 0) out vec4 outColor;
void main() {
- float coverage = texture(sampler2D(tex, texSampler), vec2(texcoord.x, texcoord.y)).r;
+ float coverage = texture(sampler2D(tex, texSampler), texcoord).r;
outColor = color * coverage;
}
vec2(cg.offset_x1, cg.offset_y1)
};
+ vec2 position = positions[gl_VertexIndex];
+ vec2 halfScreenSize = vec2(screenWidth, screenHeight) / 2.0;
+ vec2 glyphPosition = vec2(gi.x, gi.y);
+ vec2 vertexPosition = (position + glyphPosition) / halfScreenSize - 1.0;
+ gl_Position = vec4(vertexPosition, 0.0, 1.0);
+
vec2 texcoords[4] = {
vec2(cg.x0, cg.y0),
vec2(cg.x0, cg.y1),
vec2(cg.x1, cg.y1)
};
- vec2 halfScreenSize = vec2(screenWidth, screenHeight) / 2.0;
- vec2 glyphPosition = vec2(gi.x, gi.y);
- vec2 vertexPosition = positions[gl_VertexIndex] + glyphPosition;
- vec2 position = vertexPosition / halfScreenSize - 1.0;
- gl_Position = vec4(position, 0.0, 1.0);
- outTexcoord = texcoords[gl_VertexIndex] / vec2(atlasWidth, atlasHeight);
+ vec2 texcoord = texcoords[gl_VertexIndex];
+ outTexcoord = texcoord / vec2(atlasWidth, atlasHeight);
vec4 color = unpackUnorm4x8(gi.color).bgra;
outColor = color;