Skip to content

Instantly share code, notes, and snippets.

@SamedBll
Created October 6, 2017 17:48
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save SamedBll/ba857ca2a71a6d782e8fc434e8ee440a to your computer and use it in GitHub Desktop.
Save SamedBll/ba857ca2a71a6d782e8fc434e8ee440a to your computer and use it in GitHub Desktop.
B(C) - 26
struct FontCalc
{
public FontCalc(Label label, double fontSize, double containerWidth)
: this()
{
// Yazı tipi boyutunu kaydedin.
FontSize = fontSize;
// Label yüksekliğini yeniden hesaplayın.
label.FontSize = fontSize;
SizeRequest sizeRequest =
label.GetSizeRequest(containerWidth, Double.PositiveInfinity);
// Bu yüksekliği kaydedin.
TextHeight = sizeRequest.Request.Height;
}
public double FontSize { private set; get; }
public double TextHeight { private set; get; }
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment