x-graphics 0.2.1

Graphics framework for X
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
use windows::Win32::Graphics::DirectWrite::{
    DWRITE_TEXT_ALIGNMENT, DWRITE_TEXT_ALIGNMENT_CENTER, DWRITE_TEXT_ALIGNMENT_LEADING, DWRITE_TEXT_ALIGNMENT_TRAILING,
};

use crate::text::TextAlignment;

impl From<TextAlignment> for DWRITE_TEXT_ALIGNMENT {
    fn from(alignment: TextAlignment) -> Self {
        match alignment {
            TextAlignment::Left => DWRITE_TEXT_ALIGNMENT_LEADING,
            TextAlignment::Center => DWRITE_TEXT_ALIGNMENT_CENTER,
            TextAlignment::Right => DWRITE_TEXT_ALIGNMENT_TRAILING,
        }
    }
}