diff --git a/index.html b/index.html
new file mode 100644
index 0000000..9249338
--- /dev/null
+++ b/index.html
@@ -0,0 +1,149 @@
+
+
+
+
+
+
+
+
+
+ eframe template
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Loading…
+
+
+
+
+
+
+
+
+
+
+
+
\ No newline at end of file
diff --git a/src/rope_editor.rs b/src/rope_editor.rs
index bdc3067..27ebbec 100644
--- a/src/rope_editor.rs
+++ b/src/rope_editor.rs
@@ -1,6 +1,6 @@
-use std::borrow::Cow;
+use std::{borrow::Cow, sync::Arc};
-use eframe::egui::{self, Align2, NumExt, Rect, Sense, TextStyle, Ui, Vec2, pos2, text_edit::TextCursorState};
+use eframe::egui::{self, Align2, FontId, Galley, NumExt, Rect, Sense, TextBuffer, TextStyle, Ui, Vec2, pos2, text::LayoutJob, text_edit::TextCursorState};
use ropey::Rope;
#[derive(Default)]
@@ -51,4 +51,13 @@ impl RopeEdit {
fn show_content() -> () {
//let desired_height = ()
}
+}
+
+fn implement(ui: &Ui, text: &dyn TextBuffer, wrap_width: f32, font_id_clone: FontId, text_color: egui::Color32 ) -> Arc {
+ let layouter = move |ui: &Ui, text: &dyn TextBuffer, wrap_width: f32| {
+ let layout_job = LayoutJob::simple(text.as_str().to_owned(), font_id_clone.clone(), text_color, wrap_width);
+ ui.fonts_mut(|f| f.layout_job(layout_job))
+ };
+
+ layouter(ui, text, wrap_width)
}
\ No newline at end of file