FontScaling

Known direct subclasses
Density

A density of the screen.

Known indirect subclasses
ApproachIntrinsicMeasureScope

The receiver scope of a layout's intrinsic approach measurements lambdas.

ApproachMeasureScope

ApproachMeasureScope provides access to lookahead results to allow ApproachLayoutModifierNode to leverage lookahead results to define how measurements and placements approach their destination.

AwaitPointerEventScope

Receiver scope for awaiting pointer events in a call to PointerInputScope.awaitPointerEventScope.

CacheDrawScope

Handle to a drawing environment that enables caching of content based on the resolved size.

CanvasDrawScope

Implementation of DrawScope that issues drawing commands into the specified canvas and bounds via CanvasDrawScope.draw

ContentDrawScope

Receiver scope for drawing content into a layout, where the content can be drawn between other canvas operations.

DragAndDropSourceScope

This interface is deprecated. Replaced by a callback for obtain a transfer data,start detection is performed by Compose itself

DrawScope

Creates a scoped drawing environment with the provided Canvas.

GraphicsLayerScope

A scope which can be used to define the effects to apply for the content, such as scaling (scaleX, scaleY), rotation (rotationX, rotationY, rotationZ), opacity (alpha), shadow (shadowElevation, shape), and clipping (clip, shape).

InjectionScope

The receiver scope of all input injection lambdas offered in ui-test, such as performTouchInput and performMouseInput.

IntrinsicMeasureScope

The receiver scope of a layout's intrinsic measurements lambdas.

KeyInjectionScope

The receiver scope of the key input injection lambda from performKeyInput.

LazyLayoutMeasureScope

The receiver scope of a LazyLayout's measure lambda.

MeasureScope

The receiver scope of a layout's measure lambda.

MouseInjectionScope

The receiver scope of the mouse input injection lambda from performMouseInput.

MultiModalInjectionScope

The receiver scope of the multi-modal input injection lambda from performMultiModalInput.

PointerInputScope

Receiver scope for Modifier.pointerInput that permits handling pointer input.

PressGestureScope

Receiver scope for detectTapGestures's onPress lambda.

RotaryInjectionScope

The receiver scope of rotary input injection lambda from performRotaryScrollInput.

RulerScope

A scope used in MeasureScope.layout for the rulers parameter to allow a layout to define Ruler values for children.

SubcomposeMeasureScope

The receiver scope of a SubcomposeLayout's measure lambda which adds ability to dynamically subcompose a content during the measuring on top of the features provided by MeasureScope.

TouchInjectionScope

The receiver scope of the touch input injection lambda from performTouchInput.


Converts TextUnit to Dp and vice-versa.

If you are implementing this interface yourself on Android, please check the docs for important optimization tips about caching.

Summary

Public functions

open Dp

Convert Sp to Dp.

Cmn
android
open TextUnit

Convert Dp to Sp.

Cmn
android

Public properties

Float

Current user preference for the scaling factor for fonts.

Cmn
android

Public functions

toDp

open fun TextUnit.toDp(): Dp

Convert Sp to Dp.

Throws
kotlin.IllegalStateException

if TextUnit other than SP unit is specified.

toSp

open fun Dp.toSp(): TextUnit

Convert Dp to Sp. Sp is used for font size, etc.

Public properties

fontScale

val fontScaleFloat

Current user preference for the scaling factor for fonts.