Rename Texture to FontImage

This commit is contained in:
Emil Ernerfeldt
2021-12-28 21:19:24 +01:00
parent d775eb3733
commit 190c85a40f
21 changed files with 93 additions and 81 deletions
+11 -5
View File
@@ -428,11 +428,17 @@ impl Context {
.expect("No fonts available until first call to CtxRef::run()")
}
/// The egui texture, containing font characters etc.
/// The egui font image, containing font characters etc.
///
/// Not valid until first call to [`CtxRef::run()`].
/// That's because since we don't know the proper `pixels_per_point` until then.
pub fn texture(&self) -> Arc<epaint::Texture> {
self.fonts().texture()
pub fn font_image(&self) -> Arc<epaint::FontImage> {
self.fonts().font_image()
}
#[deprecated = "Renamed font_image"]
pub fn texture(&self) -> Arc<epaint::FontImage> {
self.fonts().font_image()
}
/// Tell `egui` which fonts to use.
@@ -657,7 +663,7 @@ impl Context {
let clipped_meshes = tessellator::tessellate_shapes(
shapes,
tessellation_options,
self.fonts().texture().size(),
self.fonts().font_image().size(),
);
*self.paint_stats.lock() = paint_stats.with_clipped_meshes(&clipped_meshes);
clipped_meshes
@@ -808,7 +814,7 @@ impl Context {
.show(ui, |ui| {
let mut font_definitions = self.fonts().definitions().clone();
font_definitions.ui(ui);
self.fonts().texture().ui(ui);
self.fonts().font_image().ui(ui);
self.set_fonts(font_definitions);
});
+1 -1
View File
@@ -1,7 +1,7 @@
//! uis for egui types.
use crate::*;
impl Widget for &epaint::Texture {
impl Widget for &epaint::FontImage {
fn ui(self, ui: &mut Ui) -> Response {
use epaint::Mesh;
+1 -1
View File
@@ -386,7 +386,7 @@ pub use emath::{lerp, pos2, remap, remap_clamp, vec2, Align, Align2, NumExt, Pos
pub use epaint::{
color, mutex,
text::{FontData, FontDefinitions, FontFamily, TextStyle},
ClippedMesh, Color32, Rgba, Shape, Stroke, Texture, TextureId,
ClippedMesh, Color32, FontImage, Rgba, Shape, Stroke, TextureId,
};
pub mod text {